From 15d669e2623e639909388e3f5b38eb774b4bb9df Mon Sep 17 00:00:00 2001 From: Abraham Anes Date: Tue, 9 Jun 2020 13:56:44 +0200 Subject: [PATCH] [12.0][MIG] partner_email_check: Migration to 12.0 --- partner_email_check/README.rst | 68 ++- partner_email_check/__manifest__.py | 2 +- .../i18n/partner_email_check.pot | 26 +- partner_email_check/models/res_partner.py | 4 +- partner_email_check/readme/CONFIGURE.rst | 9 + partner_email_check/readme/CONTRIBUTORS.rst | 2 + partner_email_check/readme/DESCRIPTION.rst | 8 + partner_email_check/readme/USAGE.rst | 1 + .../static/description/index.html | 441 ++++++++++++++++++ 9 files changed, 525 insertions(+), 36 deletions(-) create mode 100644 partner_email_check/readme/CONFIGURE.rst create mode 100644 partner_email_check/readme/CONTRIBUTORS.rst create mode 100644 partner_email_check/readme/DESCRIPTION.rst create mode 100644 partner_email_check/readme/USAGE.rst create mode 100644 partner_email_check/static/description/index.html diff --git a/partner_email_check/README.rst b/partner_email_check/README.rst index 87043cd82..c2ba1c366 100644 --- a/partner_email_check/README.rst +++ b/partner_email_check/README.rst @@ -1,10 +1,29 @@ -.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg - :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html - :alt: License: AGPL-3 - -=================== -Partner Email Check -=================== +==================== +Email Format Checker +==================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpartner--contact-lightgray.png?logo=github + :target: https://github.com/OCA/partner-contact/tree/12.0/partner_email_check + :alt: OCA/partner-contact +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/partner-contact-12-0/partner-contact-12-0-partner_email_check + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/134/12.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| This module validates and normalizes the field ``email`` in the model ``res.partner``. @@ -15,6 +34,11 @@ Optionally, multiple partners can not be allowed to have the same address. This will not work with multiple comma-separated email addresses in the field, although validation and normalization are still supported in such cases. +**Table of contents** + +.. contents:: + :local: + Configuration ============= @@ -36,36 +60,40 @@ This module integrate automatically in all of the view ``res.partner`` Bug Tracker =========== -Bugs are tracked on `GitHub Issues -`_. In case of trouble, please -check there if your issue has already been reported. If you spotted it first, -help us smashing it by providing a detailed and welcomed feedback. +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. Credits ======= -Images ------- +Authors +~~~~~~~ -* Odoo Community Association: `Icon `_. +* Komit Contributors ------------- +~~~~~~~~~~~~ * Vo Hoang Dat * Jean-Charles Drubay -Maintainer ----------- +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. .. image:: https://odoo-community.org/logo.png :alt: Odoo Community Association :target: https://odoo-community.org -This module is maintained by the OCA. - OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -To contribute to this module, please visit https://odoo-community.org. +This module is part of the `OCA/partner-contact `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/partner_email_check/__manifest__.py b/partner_email_check/__manifest__.py index ba7e9b2f4..b275a6b70 100644 --- a/partner_email_check/__manifest__.py +++ b/partner_email_check/__manifest__.py @@ -3,7 +3,7 @@ { 'name': 'Email Format Checker', - 'version': '11.0.2.0.0', + 'version': '12.0.1.0.0', 'summary': 'Validate email address field', 'author': "Komit, Odoo Community Association (OCA)", 'website': 'https://github.com/OCA/partner-contact', diff --git a/partner_email_check/i18n/partner_email_check.pot b/partner_email_check/i18n/partner_email_check.pot index 276f2b061..8e0ba1a70 100644 --- a/partner_email_check/i18n/partner_email_check.pot +++ b/partner_email_check/i18n/partner_email_check.pot @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 11.0\n" +"Project-Id-Version: Odoo Server 12.0\n" "Report-Msgid-Bugs-To: \n" "Last-Translator: <>\n" "Language-Team: \n" @@ -26,22 +26,27 @@ msgid "Cannot deliver to email address %s" msgstr "" #. module: partner_email_check -#: model:ir.model.fields,field_description:partner_email_check.field_res_config_settings_partner_email_check_check_deliverability +#: model:ir.model.fields,field_description:partner_email_check.field_res_config_settings__partner_email_check_check_deliverability msgid "Check deliverability of email addresses" msgstr "" +#. module: partner_email_check +#: model:ir.model,name:partner_email_check.model_res_config_settings +msgid "Config Settings" +msgstr "" + #. module: partner_email_check #: model:ir.model,name:partner_email_check.model_res_partner msgid "Contact" msgstr "" #. module: partner_email_check -#: model:ir.model.fields,help:partner_email_check.field_res_config_settings_partner_email_check_check_deliverability +#: model:ir.model.fields,help:partner_email_check.field_res_config_settings__partner_email_check_check_deliverability msgid "Don't allow email addresses with providers that don't exist" msgstr "" #. module: partner_email_check -#: model:ir.model.fields,help:partner_email_check.field_res_config_settings_partner_email_check_filter_duplicates +#: model:ir.model.fields,help:partner_email_check.field_res_config_settings__partner_email_check_filter_duplicates msgid "Don't allow multiple partners to have the same email address." msgstr "" @@ -52,12 +57,12 @@ msgid "Email '%s' is already in use." msgstr "" #. module: partner_email_check -#: model:ir.ui.view,arch_db:partner_email_check.view_general_configuration +#: model_terms:ir.ui.view,arch_db:partner_email_check.view_general_configuration msgid "Email validation" msgstr "" #. module: partner_email_check -#: model:ir.ui.view,arch_db:partner_email_check.view_general_configuration +#: model_terms:ir.ui.view,arch_db:partner_email_check.view_general_configuration msgid "Ensure that partner email addresses can be delivered to" msgstr "" @@ -68,17 +73,12 @@ msgid "Field contains multiple email addresses. This is not supported when dupli msgstr "" #. module: partner_email_check -#: model:ir.model.fields,field_description:partner_email_check.field_res_config_settings_partner_email_check_filter_duplicates +#: model:ir.model.fields,field_description:partner_email_check.field_res_config_settings__partner_email_check_filter_duplicates msgid "Filter duplicate partner email addresses" msgstr "" #. module: partner_email_check -#: model:ir.ui.view,arch_db:partner_email_check.view_general_configuration +#: model_terms:ir.ui.view,arch_db:partner_email_check.view_general_configuration msgid "Require partner email addresses to be unique" msgstr "" -#. module: partner_email_check -#: model:ir.model,name:partner_email_check.model_res_config_settings -msgid "res.config.settings" -msgstr "" - diff --git a/partner_email_check/models/res_partner.py b/partner_email_check/models/res_partner.py index 00d550b5e..65da60194 100644 --- a/partner_email_check/models/res_partner.py +++ b/partner_email_check/models/res_partner.py @@ -71,13 +71,13 @@ class ResPartner(models.Model): return result['local'].lower() + '@' + result['domain_i18n'] def _should_filter_duplicates(self): - conf = self.env['ir.config_parameter'].get_param( + conf = self.env['ir.config_parameter'].sudo().get_param( 'partner_email_check_filter_duplicates', 'False' ) return conf == 'True' def _should_check_deliverability(self): - conf = self.env['ir.config_parameter'].get_param( + conf = self.env['ir.config_parameter'].sudo().get_param( 'partner_email_check_check_deliverability', 'False' ) return conf == 'True' diff --git a/partner_email_check/readme/CONFIGURE.rst b/partner_email_check/readme/CONFIGURE.rst new file mode 100644 index 000000000..b8a310e6e --- /dev/null +++ b/partner_email_check/readme/CONFIGURE.rst @@ -0,0 +1,9 @@ +Install python package email-validator: ``sudo pip install email-validator``. + +To not allow multiple partners to have the same email address, use the +"Filter duplicate email addresses"/``partner_email_check_filter_duplicates`` +setting. + +To validate that email addresses are deliverable (that the hostname exists), +use the "Check deliverability of email addresses"/``partner_email_check_check_deliverability`` +setting. diff --git a/partner_email_check/readme/CONTRIBUTORS.rst b/partner_email_check/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..5e004a233 --- /dev/null +++ b/partner_email_check/readme/CONTRIBUTORS.rst @@ -0,0 +1,2 @@ +* Vo Hoang Dat +* Jean-Charles Drubay diff --git a/partner_email_check/readme/DESCRIPTION.rst b/partner_email_check/readme/DESCRIPTION.rst new file mode 100644 index 000000000..d15827c8f --- /dev/null +++ b/partner_email_check/readme/DESCRIPTION.rst @@ -0,0 +1,8 @@ +This module validates and normalizes the field ``email`` in the model +``res.partner``. + +As part of the normalization, email addresses are converted to lowercase. + +Optionally, multiple partners can not be allowed to have the same address. +This will not work with multiple comma-separated email addresses in the field, +although validation and normalization are still supported in such cases. diff --git a/partner_email_check/readme/USAGE.rst b/partner_email_check/readme/USAGE.rst new file mode 100644 index 000000000..56fbd95bd --- /dev/null +++ b/partner_email_check/readme/USAGE.rst @@ -0,0 +1 @@ +This module integrate automatically in all of the view ``res.partner`` diff --git a/partner_email_check/static/description/index.html b/partner_email_check/static/description/index.html new file mode 100644 index 000000000..fa5753ce8 --- /dev/null +++ b/partner_email_check/static/description/index.html @@ -0,0 +1,441 @@ + + + + + + +Email Format Checker + + + +
+

Email Format Checker

+ + +

Beta License: AGPL-3 OCA/partner-contact Translate me on Weblate Try me on Runbot

+

This module validates and normalizes the field email in the model +res.partner.

+

As part of the normalization, email addresses are converted to lowercase.

+

Optionally, multiple partners can not be allowed to have the same address. +This will not work with multiple comma-separated email addresses in the field, +although validation and normalization are still supported in such cases.

+

Table of contents

+ +
+

Configuration

+

Install python package email-validator: sudo pip install email-validator.

+

To not allow multiple partners to have the same email address, use the +“Filter duplicate email addresses”/partner_email_check_filter_duplicates +setting.

+

To validate that email addresses are deliverable (that the hostname exists), +use the “Check deliverability of email addresses”/partner_email_check_check_deliverability +setting.

+
+
+

Usage

+

This module integrate automatically in all of the view res.partner

+
+
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Komit
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

This module is part of the OCA/partner-contact project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ +