diff --git a/duplicate_contact_details_alert/README.rst b/duplicate_contact_details_alert/README.rst new file mode 100644 index 000000000..610465755 --- /dev/null +++ b/duplicate_contact_details_alert/README.rst @@ -0,0 +1,39 @@ +Duplicate Contact Details Alert +=============================== +* Duplicate Contact Details Alert module for Odoo 14. + +Installation +============ + - www.odoo.com/documentation/14.0/setup/install.html + - Install our custom addon + +License +------- +General Public License, Version 3 (AGPL v3). +(https://www.odoo.com/documentation/user/14.0/legal/licenses/licenses.html) + +Company +------- +* 'Cybrosys Techno Solutions '__ + +Credits +------- +* 'Cybrosys Techno Solutions '__ + +Contacts +-------- +* Mail Contact : odoo@cybrosys.com + +Bug Tracker +----------- +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Maintainer +========== +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit https://www.cybrosys.com + +Further information +=================== +HTML Description: ``__ diff --git a/duplicate_contact_details_alert/__init__.py b/duplicate_contact_details_alert/__init__.py new file mode 100644 index 000000000..3367fdfdb --- /dev/null +++ b/duplicate_contact_details_alert/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# + +from . import models diff --git a/duplicate_contact_details_alert/__manifest__.py b/duplicate_contact_details_alert/__manifest__.py new file mode 100644 index 000000000..947aa120a --- /dev/null +++ b/duplicate_contact_details_alert/__manifest__.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +{ + 'name': "Duplicate Contact Details Alert", + 'version': '14.0.1.0.0', + 'summary': """Duplicate Contact Details Alert""", + "category": 'Extra Tools', + 'description': """Duplicate Contact Details Alert""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['base', 'contacts'], + 'data': [ + 'views/res_config_settings_views.xml', + ], + 'images': ['static/description/banner.png'], + 'license': "LGPL-3", + 'installable': True, + 'application': False, + 'auto_install': False, +} diff --git a/duplicate_contact_details_alert/doc/RELEASE_NOTES.md b/duplicate_contact_details_alert/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..e39681810 --- /dev/null +++ b/duplicate_contact_details_alert/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 24.10.2022 +#### Version 14.0.1.0.0 +#### ADD +- Initial commit for Duplicate Contact Details Alert Module \ No newline at end of file diff --git a/duplicate_contact_details_alert/models/__init__.py b/duplicate_contact_details_alert/models/__init__.py new file mode 100644 index 000000000..facecdb3a --- /dev/null +++ b/duplicate_contact_details_alert/models/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# + +from . import res_partner +from . import res_config_settings diff --git a/duplicate_contact_details_alert/models/res_config_settings.py b/duplicate_contact_details_alert/models/res_config_settings.py new file mode 100644 index 000000000..01e98bbf5 --- /dev/null +++ b/duplicate_contact_details_alert/models/res_config_settings.py @@ -0,0 +1,66 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# + +from odoo import api, fields, models +from ast import literal_eval + + +class ResConfig(models.TransientModel): + _inherit = 'res.config.settings' + + def _get_contacts_fields_domain(self): + return [ + ('model', '=', 'res.partner'), ('store', '=', True), + ('ttype', 'in', ['binary', 'char'])] + + is_unique_contact = fields.Boolean(string="Unique Contacts Alert") + unique_contact_ids = fields.Many2many( + 'ir.model.fields', string='Contact Fields', + domain=_get_contacts_fields_domain, + help='Warning to avoid duplication of customer/vendor' + ' details in the system') + + def set_values(self): + super(ResConfig, self).set_values() + self.env['ir.config_parameter'].set_param( + 'duplicate_contact_details_alert.is_unique_contact', + self.is_unique_contact) + + self.env['ir.config_parameter'].set_param( + 'duplicate_contact_details_alert.unique_contact_ids', + self.unique_contact_ids.ids) + + @api.model + def get_values(self): + res = super(ResConfig, self).get_values() + params = self.env['ir.config_parameter'].sudo() + contact_field_ids = params.get_param( + 'duplicate_contact_details_alert.unique_contact_ids') + if contact_field_ids: + res.update( + is_unique_contact=params.get_param( + 'duplicate_contact_details_alert.is_unique_contact'), + unique_contact_ids=[(6, 0, literal_eval(contact_field_ids))], + ) + return res + else: + return res diff --git a/duplicate_contact_details_alert/models/res_partner.py b/duplicate_contact_details_alert/models/res_partner.py new file mode 100644 index 000000000..63ef73756 --- /dev/null +++ b/duplicate_contact_details_alert/models/res_partner.py @@ -0,0 +1,79 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# + +from odoo import api, fields, models, _ +from odoo.exceptions import UserError, ValidationError +import ast + + +class ResPartner(models.Model): + _inherit = 'res.partner' + + @api.model + def create(self, vals): + unique_contact_ids = self.env[ + 'ir.config_parameter'].sudo().get_param( + 'duplicate_contact_details_alert.unique_contact_ids') + if unique_contact_ids: + fields_list = ast.literal_eval(unique_contact_ids) + for x in fields_list: + contact_fields = self.env['ir.model.fields'].browse(x) + field_vals = contact_fields.name + if vals.get(field_vals): + partner = self.env['res.partner'].search( + [(field_vals, '=', vals.get(field_vals))], limit=1) + if partner: + raise ValidationError( + _("The %s is already" + " used for contact %s.") % + (contact_fields.name, partner.name)) + else: + res = super(ResPartner, self).create(vals) + return res + else: + res = super(ResPartner, self).create(vals) + return res + + def write(self, vals): + unique_contact_ids = self.env[ + 'ir.config_parameter'].sudo().get_param( + 'duplicate_contact_details_alert.unique_contact_ids') + if unique_contact_ids: + fields_list = ast.literal_eval(unique_contact_ids) + for x in fields_list: + contact_fields = self.env['ir.model.fields'].browse(x) + field_vals = contact_fields.name + if vals.get(field_vals): + partner = self.env['res.partner'].search( + [(field_vals, '=', vals.get(field_vals))], limit=1) + if partner: + raise ValidationError( + _("The %s is already" + " used for contact %s.") % + (contact_fields.name, partner.name)) + else: + res = super(ResPartner, self).write(vals) + return res + + else: + res = super(ResPartner, self).write(vals) + return res diff --git a/duplicate_contact_details_alert/static/description/assets/icons/check.png b/duplicate_contact_details_alert/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/duplicate_contact_details_alert/static/description/assets/icons/check.png differ diff --git a/duplicate_contact_details_alert/static/description/assets/icons/chevron.png b/duplicate_contact_details_alert/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/duplicate_contact_details_alert/static/description/assets/icons/chevron.png differ diff --git a/duplicate_contact_details_alert/static/description/assets/icons/cogs.png b/duplicate_contact_details_alert/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/duplicate_contact_details_alert/static/description/assets/icons/cogs.png differ diff --git a/duplicate_contact_details_alert/static/description/assets/icons/consultation.png b/duplicate_contact_details_alert/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/duplicate_contact_details_alert/static/description/assets/icons/consultation.png differ diff --git a/duplicate_contact_details_alert/static/description/assets/icons/ecom-black.png b/duplicate_contact_details_alert/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/duplicate_contact_details_alert/static/description/assets/icons/ecom-black.png differ diff --git a/duplicate_contact_details_alert/static/description/assets/icons/education-black.png b/duplicate_contact_details_alert/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/duplicate_contact_details_alert/static/description/assets/icons/education-black.png differ diff --git a/duplicate_contact_details_alert/static/description/assets/icons/hotel-black.png b/duplicate_contact_details_alert/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/duplicate_contact_details_alert/static/description/assets/icons/hotel-black.png differ diff --git a/duplicate_contact_details_alert/static/description/assets/icons/license.png b/duplicate_contact_details_alert/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/duplicate_contact_details_alert/static/description/assets/icons/license.png differ diff --git a/duplicate_contact_details_alert/static/description/assets/icons/lifebuoy.png b/duplicate_contact_details_alert/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/duplicate_contact_details_alert/static/description/assets/icons/lifebuoy.png differ diff --git a/duplicate_contact_details_alert/static/description/assets/icons/logo.png b/duplicate_contact_details_alert/static/description/assets/icons/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/duplicate_contact_details_alert/static/description/assets/icons/logo.png differ diff --git a/duplicate_contact_details_alert/static/description/assets/icons/manufacturing-black.png b/duplicate_contact_details_alert/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/duplicate_contact_details_alert/static/description/assets/icons/manufacturing-black.png differ diff --git a/duplicate_contact_details_alert/static/description/assets/icons/pos-black.png b/duplicate_contact_details_alert/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/duplicate_contact_details_alert/static/description/assets/icons/pos-black.png differ diff --git a/duplicate_contact_details_alert/static/description/assets/icons/puzzle.png b/duplicate_contact_details_alert/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/duplicate_contact_details_alert/static/description/assets/icons/puzzle.png differ diff --git a/duplicate_contact_details_alert/static/description/assets/icons/restaurant-black.png b/duplicate_contact_details_alert/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/duplicate_contact_details_alert/static/description/assets/icons/restaurant-black.png differ diff --git a/duplicate_contact_details_alert/static/description/assets/icons/service-black.png b/duplicate_contact_details_alert/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/duplicate_contact_details_alert/static/description/assets/icons/service-black.png differ diff --git a/duplicate_contact_details_alert/static/description/assets/icons/trading-black.png b/duplicate_contact_details_alert/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/duplicate_contact_details_alert/static/description/assets/icons/trading-black.png differ diff --git a/duplicate_contact_details_alert/static/description/assets/icons/training.png b/duplicate_contact_details_alert/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/duplicate_contact_details_alert/static/description/assets/icons/training.png differ diff --git a/duplicate_contact_details_alert/static/description/assets/icons/update.png b/duplicate_contact_details_alert/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/duplicate_contact_details_alert/static/description/assets/icons/update.png differ diff --git a/duplicate_contact_details_alert/static/description/assets/icons/user.png b/duplicate_contact_details_alert/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/duplicate_contact_details_alert/static/description/assets/icons/user.png differ diff --git a/duplicate_contact_details_alert/static/description/assets/icons/wrench.png b/duplicate_contact_details_alert/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/duplicate_contact_details_alert/static/description/assets/icons/wrench.png differ diff --git a/duplicate_contact_details_alert/static/description/assets/modules/budget_image.png b/duplicate_contact_details_alert/static/description/assets/modules/budget_image.png new file mode 100644 index 000000000..b50130c7d Binary files /dev/null and b/duplicate_contact_details_alert/static/description/assets/modules/budget_image.png differ diff --git a/duplicate_contact_details_alert/static/description/assets/modules/credit_image.png b/duplicate_contact_details_alert/static/description/assets/modules/credit_image.png new file mode 100644 index 000000000..3ad04ecfd Binary files /dev/null and b/duplicate_contact_details_alert/static/description/assets/modules/credit_image.png differ diff --git a/duplicate_contact_details_alert/static/description/assets/modules/employee_image.png b/duplicate_contact_details_alert/static/description/assets/modules/employee_image.png new file mode 100644 index 000000000..30ad58232 Binary files /dev/null and b/duplicate_contact_details_alert/static/description/assets/modules/employee_image.png differ diff --git a/duplicate_contact_details_alert/static/description/assets/modules/export_image.png b/duplicate_contact_details_alert/static/description/assets/modules/export_image.png new file mode 100644 index 000000000..492980ad0 Binary files /dev/null and b/duplicate_contact_details_alert/static/description/assets/modules/export_image.png differ diff --git a/duplicate_contact_details_alert/static/description/assets/modules/gantt_image.png b/duplicate_contact_details_alert/static/description/assets/modules/gantt_image.png new file mode 100644 index 000000000..1ae7cfe3b Binary files /dev/null and b/duplicate_contact_details_alert/static/description/assets/modules/gantt_image.png differ diff --git a/duplicate_contact_details_alert/static/description/assets/modules/quotation_image.png b/duplicate_contact_details_alert/static/description/assets/modules/quotation_image.png new file mode 100644 index 000000000..499b1a72f Binary files /dev/null and b/duplicate_contact_details_alert/static/description/assets/modules/quotation_image.png differ diff --git a/duplicate_contact_details_alert/static/description/assets/screenshots/dup_con1.png b/duplicate_contact_details_alert/static/description/assets/screenshots/dup_con1.png new file mode 100644 index 000000000..7bab659f1 Binary files /dev/null and b/duplicate_contact_details_alert/static/description/assets/screenshots/dup_con1.png differ diff --git a/duplicate_contact_details_alert/static/description/assets/screenshots/dup_con2.png b/duplicate_contact_details_alert/static/description/assets/screenshots/dup_con2.png new file mode 100644 index 000000000..a851fa3ce Binary files /dev/null and b/duplicate_contact_details_alert/static/description/assets/screenshots/dup_con2.png differ diff --git a/duplicate_contact_details_alert/static/description/assets/screenshots/hero.gif b/duplicate_contact_details_alert/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..5786116fd Binary files /dev/null and b/duplicate_contact_details_alert/static/description/assets/screenshots/hero.gif differ diff --git a/duplicate_contact_details_alert/static/description/banner.png b/duplicate_contact_details_alert/static/description/banner.png new file mode 100644 index 000000000..9d89058ea Binary files /dev/null and b/duplicate_contact_details_alert/static/description/banner.png differ diff --git a/duplicate_contact_details_alert/static/description/icon.png b/duplicate_contact_details_alert/static/description/icon.png new file mode 100644 index 000000000..c608ac41e Binary files /dev/null and b/duplicate_contact_details_alert/static/description/icon.png differ diff --git a/duplicate_contact_details_alert/static/description/index.html b/duplicate_contact_details_alert/static/description/index.html new file mode 100644 index 000000000..c1fafd2d7 --- /dev/null +++ b/duplicate_contact_details_alert/static/description/index.html @@ -0,0 +1,559 @@ +
+
+
+
+ +
+
+
+ Community +
+ +
+
+
+
+ +
+
+
+

+ Duplicate Contact Alert

+

+ Duplicate contact alert module helps to detect duplicate contact values. +

+ +
+
+ + + +
+
+

+ Overview +

+
+ +
+

+ The Duplicate contact alert module helps to detect duplicate contact values. When a user enters the same value in the contact, it returns a validation error message, which helps customers prevent duplicate entries. +

+
+

+ +
+ + +
+
+

+ Features +

+
+ +
+
+ +
+
+

+ Select Multiple Fields

+

+ User can select multiple fields to check for duplicate values. + +

+
+
+ + +
+
+ +
+
+

+ Validation Alert

+

+ Validation warning is triggered when users enter duplicate values. +

+
+
+ + +
+ +
+
+

+ Screenshots +

+
+
+

+ Enable the "Unique Contacts" button.

+

+ Go to Settings --> Enable "Unique Contacts" button and select Fields. +

+ +
+ +
+

+ Validation alert for duplicate contact values

+

+ When you enter the same value in the contact fields, it raises a validation error message. +

+ +
+ +
+ +
+
+

Suggested Products

+
+ + +
+
+ + + +
+
+
+

Our Services

+
+
+ +
+
+ +
+
+ Odoo + Customization
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ Odoo + Support
+
+ + +
+
+ +
+
+ Hire + Odoo + Developer
+
+ +
+
+ +
+
+ Odoo + Integration
+
+ +
+
+ +
+
+ Odoo + Migration
+
+ + +
+
+ +
+
+ Odoo + Consultancy
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ Odoo + Licensing Consultancy
+
+
+
+ + + +
+
+
+

Our Industries

+
+
+ +
+
+ +
+ Trading +
+

+ Easily procure + and + sell your products

+
+
+ +
+
+ +
+ POS +
+

+ Easy + configuration + and convivial experience

+
+
+ +
+
+ +
+ Education +
+

+ A platform for + educational management

+
+
+ +
+
+ +
+ Manufacturing +
+

+ Plan, track and + schedule your operations

+
+
+ +
+
+ +
+ E-commerce & Website +
+

+ Mobile + friendly, + awe-inspiring product pages

+
+
+ +
+
+ +
+ Service Management +
+

+ Keep track of + services and invoice

+
+
+ +
+
+ +
+ Restaurant +
+

+ Run your bar or + restaurant methodically

+
+
+ +
+
+ +
+ Hotel Management +
+

+ An + all-inclusive + hotel management application

+
+
+ +
+
+ + + + + +
+
+
+

Need Help?

+
+
+
+ + +
+ +
+ + +
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+
+ + +
\ No newline at end of file diff --git a/duplicate_contact_details_alert/views/res_config_settings_views.xml b/duplicate_contact_details_alert/views/res_config_settings_views.xml new file mode 100644 index 000000000..7a1deb2ac --- /dev/null +++ b/duplicate_contact_details_alert/views/res_config_settings_views.xml @@ -0,0 +1,39 @@ + + + + + res.config.settings.view.form.inherit.duplicate_contact_details_alert + res.config.settings + + + + +
+
+
+
+ +
+
+ Unique Contacts + +
Validation alerts for duplicate contact details
+
+
+
+
+
+
+
+
+
+ +
\ No newline at end of file