diff --git a/partner_deduplicate_filter/README.rst b/partner_deduplicate_filter/README.rst new file mode 100644 index 000000000..16f41b1da --- /dev/null +++ b/partner_deduplicate_filter/README.rst @@ -0,0 +1,98 @@ +====================================== +Exclude records from the deduplication +====================================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! 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/14.0/partner_deduplicate_filter + :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-14-0/partner-contact-14-0-partner_deduplicate_filter + :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/14.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module extends the possibilities of the contact deduplication allowing +to filter the applicable set according to several criteria. + +For now, only the filter for restricting the deduplication to only companies or +only contacts is implemented. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +To use this module, you need to: + +#. Follow the instructions in the partner_deduplicate_acl addon to set up the + correct user permissions. +#. Go to *Contacts > Tools > Deduplicate Contacts*. +#. Mark "'Is a company?' field selected", "Parent company not set" or + "Parent company set (Contacts)" in the section 'Exclude contacts having'. +#. This criteria will be used for excluding in the deduplication the selected + kind of records. + +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 +~~~~~~~ + +* Tecnativa + +Contributors +~~~~~~~~~~~~ + + +* `Tecnativa `_: + * Pedro M. Baeza + * Vicent Cubells + * Luis M. Ontalba + * Victor M.M. Torres + * João Marques + +* Kevin Khao + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +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. diff --git a/partner_deduplicate_filter/__init__.py b/partner_deduplicate_filter/__init__.py new file mode 100644 index 000000000..a18dad97f --- /dev/null +++ b/partner_deduplicate_filter/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from . import wizards diff --git a/partner_deduplicate_filter/__manifest__.py b/partner_deduplicate_filter/__manifest__.py new file mode 100644 index 000000000..29ab5bd4b --- /dev/null +++ b/partner_deduplicate_filter/__manifest__.py @@ -0,0 +1,16 @@ +# Copyright 2016 Tecnativa - Pedro M. Baeza +# Copyright 2017 Tecnativa - Vicent Cubells +# Copyright 2019 Tecnativa - Victor M.M Torres +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +{ + "name": "Exclude records from the deduplication", + "version": "14.0.1.0.0", + "category": "Tools", + "website": "https://github.com/OCA/partner-contact", + "author": "Tecnativa, Odoo Community Association (OCA)", + "license": "AGPL-3", + "installable": True, + "depends": ["partner_deduplicate_acl"], + "data": ["wizards/partner_merge_view.xml"], +} diff --git a/partner_deduplicate_filter/i18n/crm_deduplicate_filter.pot b/partner_deduplicate_filter/i18n/crm_deduplicate_filter.pot new file mode 100644 index 000000000..a93b58c2d --- /dev/null +++ b/partner_deduplicate_filter/i18n/crm_deduplicate_filter.pot @@ -0,0 +1,35 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * partner_deduplicate_filter +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: partner_deduplicate_filter +#: model:ir.model.fields,field_description:partner_deduplicate_filter.field_base_partner_merge_automatic_wizard_exclude_is_company +msgid "'Is a company?' field selected" +msgstr "" + +#. module: partner_deduplicate_filter +#: model:ir.model.fields,field_description:partner_deduplicate_filter.field_base_partner_merge_automatic_wizard_exclude_not_parent +msgid "Parent company not set" +msgstr "" + +#. module: partner_deduplicate_filter +#: model:ir.model.fields,field_description:partner_deduplicate_filter.field_base_partner_merge_automatic_wizard_exclude_parent +msgid "Parent company set (Contacts)" +msgstr "" + +#. module: partner_deduplicate_filter +#: model:ir.model,name:partner_deduplicate_filter.model_base_partner_merge_automatic_wizard +msgid "base.partner.merge.automatic.wizard" +msgstr "" + diff --git a/partner_deduplicate_filter/i18n/de.po b/partner_deduplicate_filter/i18n/de.po new file mode 100644 index 000000000..8bcd1e5c9 --- /dev/null +++ b/partner_deduplicate_filter/i18n/de.po @@ -0,0 +1,39 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * partner_deduplicate_filter +# +# Translators: +# Rudolf Schnapka , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-03-28 02:27+0000\n" +"PO-Revision-Date: 2017-03-28 02:27+0000\n" +"Last-Translator: Rudolf Schnapka , 2017\n" +"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" +"Language: de\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: partner_deduplicate_filter +#: model:ir.model.fields,field_description:partner_deduplicate_filter.field_base_partner_merge_automatic_wizard__exclude_is_company +msgid "'Is a company?' field selected" +msgstr "'Ist Unternehmen'-Feld ausgewählt" + +#. module: partner_deduplicate_filter +#: model:ir.model,name:partner_deduplicate_filter.model_base_partner_merge_automatic_wizard +msgid "Merge Partner Wizard" +msgstr "" + +#. module: partner_deduplicate_filter +#: model:ir.model.fields,field_description:partner_deduplicate_filter.field_base_partner_merge_automatic_wizard__exclude_not_parent +msgid "Parent company not set" +msgstr "Übergeordnetes Unternehmen nicht gepflegt" + +#. module: partner_deduplicate_filter +#: model:ir.model.fields,field_description:partner_deduplicate_filter.field_base_partner_merge_automatic_wizard__exclude_parent +msgid "Parent company set (Contacts)" +msgstr "Übergeordnetes Unternehmen gesetzt (Kontakte)" diff --git a/partner_deduplicate_filter/i18n/es.po b/partner_deduplicate_filter/i18n/es.po new file mode 100644 index 000000000..20db28c53 --- /dev/null +++ b/partner_deduplicate_filter/i18n/es.po @@ -0,0 +1,39 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * partner_deduplicate_filter +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-03-28 02:27+0000\n" +"PO-Revision-Date: 2017-03-28 02:27+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: partner_deduplicate_filter +#: model:ir.model.fields,field_description:partner_deduplicate_filter.field_base_partner_merge_automatic_wizard__exclude_is_company +msgid "'Is a company?' field selected" +msgstr "El campo '¿Es una compañía?' seleccionado" + +#. module: partner_deduplicate_filter +#: model:ir.model,name:partner_deduplicate_filter.model_base_partner_merge_automatic_wizard +msgid "Merge Partner Wizard" +msgstr "" + +#. module: partner_deduplicate_filter +#: model:ir.model.fields,field_description:partner_deduplicate_filter.field_base_partner_merge_automatic_wizard__exclude_not_parent +msgid "Parent company not set" +msgstr "La compañía padre no establecida" + +#. module: partner_deduplicate_filter +#: model:ir.model.fields,field_description:partner_deduplicate_filter.field_base_partner_merge_automatic_wizard__exclude_parent +msgid "Parent company set (Contacts)" +msgstr "La compañía padre establecida (Contactos)" diff --git a/partner_deduplicate_filter/i18n/hr.po b/partner_deduplicate_filter/i18n/hr.po new file mode 100644 index 000000000..bc00f8ba2 --- /dev/null +++ b/partner_deduplicate_filter/i18n/hr.po @@ -0,0 +1,40 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * partner_deduplicate_filter +# +# Translators: +# Bole , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-07-08 01:22+0000\n" +"PO-Revision-Date: 2017-07-08 01:22+0000\n" +"Last-Translator: Bole , 2017\n" +"Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n" +"Language: hr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" + +#. module: partner_deduplicate_filter +#: model:ir.model.fields,field_description:partner_deduplicate_filter.field_base_partner_merge_automatic_wizard__exclude_is_company +msgid "'Is a company?' field selected" +msgstr "" + +#. module: partner_deduplicate_filter +#: model:ir.model,name:partner_deduplicate_filter.model_base_partner_merge_automatic_wizard +msgid "Merge Partner Wizard" +msgstr "" + +#. module: partner_deduplicate_filter +#: model:ir.model.fields,field_description:partner_deduplicate_filter.field_base_partner_merge_automatic_wizard__exclude_not_parent +msgid "Parent company not set" +msgstr "" + +#. module: partner_deduplicate_filter +#: model:ir.model.fields,field_description:partner_deduplicate_filter.field_base_partner_merge_automatic_wizard__exclude_parent +msgid "Parent company set (Contacts)" +msgstr "" diff --git a/partner_deduplicate_filter/i18n/nl_NL.po b/partner_deduplicate_filter/i18n/nl_NL.po new file mode 100644 index 000000000..a1bb05454 --- /dev/null +++ b/partner_deduplicate_filter/i18n/nl_NL.po @@ -0,0 +1,40 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * partner_deduplicate_filter +# +# Translators: +# Peter Hageman , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-09 08:00+0000\n" +"PO-Revision-Date: 2017-06-09 08:00+0000\n" +"Last-Translator: Peter Hageman , 2017\n" +"Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/" +"teams/23907/nl_NL/)\n" +"Language: nl_NL\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: partner_deduplicate_filter +#: model:ir.model.fields,field_description:partner_deduplicate_filter.field_base_partner_merge_automatic_wizard__exclude_is_company +msgid "'Is a company?' field selected" +msgstr "'Is een bedrijf?' veld geselecteerd" + +#. module: partner_deduplicate_filter +#: model:ir.model,name:partner_deduplicate_filter.model_base_partner_merge_automatic_wizard +msgid "Merge Partner Wizard" +msgstr "" + +#. module: partner_deduplicate_filter +#: model:ir.model.fields,field_description:partner_deduplicate_filter.field_base_partner_merge_automatic_wizard__exclude_not_parent +msgid "Parent company not set" +msgstr "Moederbedrijf niet ingesteld" + +#. module: partner_deduplicate_filter +#: model:ir.model.fields,field_description:partner_deduplicate_filter.field_base_partner_merge_automatic_wizard__exclude_parent +msgid "Parent company set (Contacts)" +msgstr "" diff --git a/partner_deduplicate_filter/i18n/partner_deduplicate_filter.pot b/partner_deduplicate_filter/i18n/partner_deduplicate_filter.pot new file mode 100644 index 000000000..639c90cad --- /dev/null +++ b/partner_deduplicate_filter/i18n/partner_deduplicate_filter.pot @@ -0,0 +1,34 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * partner_deduplicate_filter +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: partner_deduplicate_filter +#: model:ir.model.fields,field_description:partner_deduplicate_filter.field_base_partner_merge_automatic_wizard__exclude_is_company +msgid "'Is a company?' field selected" +msgstr "" + +#. module: partner_deduplicate_filter +#: model:ir.model,name:partner_deduplicate_filter.model_base_partner_merge_automatic_wizard +msgid "Merge Partner Wizard" +msgstr "" + +#. module: partner_deduplicate_filter +#: model:ir.model.fields,field_description:partner_deduplicate_filter.field_base_partner_merge_automatic_wizard__exclude_not_parent +msgid "Parent company not set" +msgstr "" + +#. module: partner_deduplicate_filter +#: model:ir.model.fields,field_description:partner_deduplicate_filter.field_base_partner_merge_automatic_wizard__exclude_parent +msgid "Parent company set (Contacts)" +msgstr "" diff --git a/partner_deduplicate_filter/i18n/sk.po b/partner_deduplicate_filter/i18n/sk.po new file mode 100644 index 000000000..874012e0b --- /dev/null +++ b/partner_deduplicate_filter/i18n/sk.po @@ -0,0 +1,39 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * partner_deduplicate_filter +# +# Translators: +# gebri , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-03-28 02:27+0000\n" +"PO-Revision-Date: 2017-03-28 02:27+0000\n" +"Last-Translator: gebri , 2017\n" +"Language-Team: Slovak (https://www.transifex.com/oca/teams/23907/sk/)\n" +"Language: sk\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" + +#. module: partner_deduplicate_filter +#: model:ir.model.fields,field_description:partner_deduplicate_filter.field_base_partner_merge_automatic_wizard__exclude_is_company +msgid "'Is a company?' field selected" +msgstr "" + +#. module: partner_deduplicate_filter +#: model:ir.model,name:partner_deduplicate_filter.model_base_partner_merge_automatic_wizard +msgid "Merge Partner Wizard" +msgstr "" + +#. module: partner_deduplicate_filter +#: model:ir.model.fields,field_description:partner_deduplicate_filter.field_base_partner_merge_automatic_wizard__exclude_not_parent +msgid "Parent company not set" +msgstr "" + +#. module: partner_deduplicate_filter +#: model:ir.model.fields,field_description:partner_deduplicate_filter.field_base_partner_merge_automatic_wizard__exclude_parent +msgid "Parent company set (Contacts)" +msgstr "" diff --git a/partner_deduplicate_filter/i18n/sl.po b/partner_deduplicate_filter/i18n/sl.po new file mode 100644 index 000000000..d43033e86 --- /dev/null +++ b/partner_deduplicate_filter/i18n/sl.po @@ -0,0 +1,40 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * partner_deduplicate_filter +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-03-28 02:27+0000\n" +"PO-Revision-Date: 2017-03-28 02:27+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Slovenian (https://www.transifex.com/oca/teams/23907/sl/)\n" +"Language: sl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n" +"%100==4 ? 2 : 3);\n" + +#. module: partner_deduplicate_filter +#: model:ir.model.fields,field_description:partner_deduplicate_filter.field_base_partner_merge_automatic_wizard__exclude_is_company +msgid "'Is a company?' field selected" +msgstr "Polje 'Je pravna oseba' izbrano" + +#. module: partner_deduplicate_filter +#: model:ir.model,name:partner_deduplicate_filter.model_base_partner_merge_automatic_wizard +msgid "Merge Partner Wizard" +msgstr "" + +#. module: partner_deduplicate_filter +#: model:ir.model.fields,field_description:partner_deduplicate_filter.field_base_partner_merge_automatic_wizard__exclude_not_parent +msgid "Parent company not set" +msgstr "Nadrejena družba ni nastavljena." + +#. module: partner_deduplicate_filter +#: model:ir.model.fields,field_description:partner_deduplicate_filter.field_base_partner_merge_automatic_wizard__exclude_parent +msgid "Parent company set (Contacts)" +msgstr "Nadrejena družba nastavljena (stiki)" diff --git a/partner_deduplicate_filter/i18n/tr.po b/partner_deduplicate_filter/i18n/tr.po new file mode 100644 index 000000000..e85ac02ac --- /dev/null +++ b/partner_deduplicate_filter/i18n/tr.po @@ -0,0 +1,40 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * partner_deduplicate_filter +# +# Translators: +# OCA Transbot , 2017 +# Ediz Duman , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-10 03:36+0000\n" +"PO-Revision-Date: 2017-06-10 03:36+0000\n" +"Last-Translator: Ediz Duman , 2017\n" +"Language-Team: Turkish (https://www.transifex.com/oca/teams/23907/tr/)\n" +"Language: tr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: partner_deduplicate_filter +#: model:ir.model.fields,field_description:partner_deduplicate_filter.field_base_partner_merge_automatic_wizard__exclude_is_company +msgid "'Is a company?' field selected" +msgstr "' Bu bir şirket mi? ' Alanı seçili ise" + +#. module: partner_deduplicate_filter +#: model:ir.model,name:partner_deduplicate_filter.model_base_partner_merge_automatic_wizard +msgid "Merge Partner Wizard" +msgstr "" + +#. module: partner_deduplicate_filter +#: model:ir.model.fields,field_description:partner_deduplicate_filter.field_base_partner_merge_automatic_wizard__exclude_not_parent +msgid "Parent company not set" +msgstr "Üst firma Ayarlanmamışsa" + +#. module: partner_deduplicate_filter +#: model:ir.model.fields,field_description:partner_deduplicate_filter.field_base_partner_merge_automatic_wizard__exclude_parent +msgid "Parent company set (Contacts)" +msgstr "" diff --git a/partner_deduplicate_filter/readme/CONTRIBUTORS.rst b/partner_deduplicate_filter/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..54f7b2a65 --- /dev/null +++ b/partner_deduplicate_filter/readme/CONTRIBUTORS.rst @@ -0,0 +1,9 @@ + +* `Tecnativa `_: + * Pedro M. Baeza + * Vicent Cubells + * Luis M. Ontalba + * Victor M.M. Torres + * João Marques + +* Kevin Khao diff --git a/partner_deduplicate_filter/readme/DESCRIPTION.rst b/partner_deduplicate_filter/readme/DESCRIPTION.rst new file mode 100644 index 000000000..5264f9b5a --- /dev/null +++ b/partner_deduplicate_filter/readme/DESCRIPTION.rst @@ -0,0 +1,5 @@ +This module extends the possibilities of the contact deduplication allowing +to filter the applicable set according to several criteria. + +For now, only the filter for restricting the deduplication to only companies or +only contacts is implemented. diff --git a/partner_deduplicate_filter/readme/USAGE.rst b/partner_deduplicate_filter/readme/USAGE.rst new file mode 100644 index 000000000..be7322640 --- /dev/null +++ b/partner_deduplicate_filter/readme/USAGE.rst @@ -0,0 +1,9 @@ +To use this module, you need to: + +#. Follow the instructions in the partner_deduplicate_acl addon to set up the + correct user permissions. +#. Go to *Contacts > Tools > Deduplicate Contacts*. +#. Mark "'Is a company?' field selected", "Parent company not set" or + "Parent company set (Contacts)" in the section 'Exclude contacts having'. +#. This criteria will be used for excluding in the deduplication the selected + kind of records. diff --git a/partner_deduplicate_filter/static/description/icon.png b/partner_deduplicate_filter/static/description/icon.png new file mode 100644 index 000000000..49b724769 Binary files /dev/null and b/partner_deduplicate_filter/static/description/icon.png differ diff --git a/partner_deduplicate_filter/static/description/icon.svg b/partner_deduplicate_filter/static/description/icon.svg new file mode 100644 index 000000000..7ba20919f --- /dev/null +++ b/partner_deduplicate_filter/static/description/icon.svg @@ -0,0 +1,102 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + diff --git a/partner_deduplicate_filter/static/description/index.html b/partner_deduplicate_filter/static/description/index.html new file mode 100644 index 000000000..1a440c361 --- /dev/null +++ b/partner_deduplicate_filter/static/description/index.html @@ -0,0 +1,442 @@ + + + + + + +Exclude records from the deduplication + + + +
+

Exclude records from the deduplication

+ + +

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

+

This module extends the possibilities of the contact deduplication allowing +to filter the applicable set according to several criteria.

+

For now, only the filter for restricting the deduplication to only companies or +only contacts is implemented.

+

Table of contents

+ +
+

Usage

+

To use this module, you need to:

+
    +
  1. Follow the instructions in the partner_deduplicate_acl addon to set up the +correct user permissions.
  2. +
  3. Go to Contacts > Tools > Deduplicate Contacts.
  4. +
  5. Mark “‘Is a company?’ field selected”, “Parent company not set” or +“Parent company set (Contacts)” in the section ‘Exclude contacts having’.
  6. +
  7. This criteria will be used for excluding in the deduplication the selected +kind of records.
  8. +
+
+
+

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

+
    +
  • Tecnativa
  • +
+
+
+

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.

+
+
+
+ + diff --git a/partner_deduplicate_filter/tests/__init__.py b/partner_deduplicate_filter/tests/__init__.py new file mode 100644 index 000000000..62942e752 --- /dev/null +++ b/partner_deduplicate_filter/tests/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from . import test_partner_deduplicate_filter diff --git a/partner_deduplicate_filter/tests/test_partner_deduplicate_filter.py b/partner_deduplicate_filter/tests/test_partner_deduplicate_filter.py new file mode 100644 index 000000000..416b20b70 --- /dev/null +++ b/partner_deduplicate_filter/tests/test_partner_deduplicate_filter.py @@ -0,0 +1,82 @@ +# Copyright 2016 Tecnativa - Pedro M. Baeza +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from odoo.tests import common +from odoo.tools.safe_eval import safe_eval + + +class TestDeduplicateFilter(common.TransactionCase): + def setUp(self): + super().setUp() + self.partner_1 = self.env["res.partner"].create( + { + "name": "Partner 1", + "email": "partner1@example.org", + "is_company": True, + "parent_id": False, + } + ) + self.partner_1.copy() + self.partner_2 = self.env["res.partner"].create( + { + "name": "Partner 2", + "email": "partner2@example.org", + "is_company": False, + "parent_id": self.partner_1.id, + } + ) + self.partner_2.copy() + self.partner_3 = self.env["res.partner"].create( + { + "name": "Partner 3", + "email": "partner3@example.org", + "is_company": False, + "parent_id": False, + } + ) + self.partner_3.copy() + self.wizard = self.env["base.partner.merge.automatic.wizard"].create( + {"group_by_email": True} + ) + + def test_deduplicate_exclude_is_company(self): + self.wizard.exclude_is_company = True + self.wizard.action_start_manual_process() + matched_founds = 0 + for line in self.wizard.line_ids: + match_ids = safe_eval(line.aggr_ids) + if self.partner_1.id in match_ids: + self.assertTrue(False, "Partner with is company not excluded") + if self.partner_2.id in match_ids: + matched_founds += 1 + if self.partner_3.id in match_ids: + matched_founds += 1 + self.assertEqual(matched_founds, 2) + + def test_deduplicate_exclude_not_parent(self): + self.wizard.exclude_not_parent = True + self.wizard.action_start_manual_process() + matched_founds = 0 + for line in self.wizard.line_ids: + match_ids = safe_eval(line.aggr_ids) + if self.partner_1.id in match_ids: + self.assertTrue(False, "Partner without parent not excluded") + if self.partner_3.id in match_ids: + self.assertTrue(False, "Partner without parent not excluded") + if self.partner_2.id in match_ids: + matched_founds += 1 + self.assertEqual(matched_founds, 1) + + def test_deduplicate_exclude_parent(self): + self.wizard.exclude_parent = True + self.wizard.action_start_manual_process() + matched_founds = 0 + for line in self.wizard.line_ids: + match_ids = safe_eval(line.aggr_ids) + if self.partner_2.id in match_ids: + self.assertTrue(False, "Partner with parent not excluded") + if self.partner_1.id in match_ids: + matched_founds += 1 + if self.partner_3.id in match_ids: + matched_founds += 1 + self.assertEqual(matched_founds, 2) diff --git a/partner_deduplicate_filter/wizards/__init__.py b/partner_deduplicate_filter/wizards/__init__.py new file mode 100644 index 000000000..a8a03bc54 --- /dev/null +++ b/partner_deduplicate_filter/wizards/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from . import partner_merge diff --git a/partner_deduplicate_filter/wizards/partner_merge.py b/partner_deduplicate_filter/wizards/partner_merge.py new file mode 100644 index 000000000..77fb02374 --- /dev/null +++ b/partner_deduplicate_filter/wizards/partner_merge.py @@ -0,0 +1,31 @@ +# Copyright 2016 Tecnativa - Pedro M. Baeza +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from odoo import fields, models + + +class BasePartnerMergeAutomaticWizard(models.TransientModel): + _inherit = "base.partner.merge.automatic.wizard" + + exclude_is_company = fields.Boolean("'Is a company?' field selected") + exclude_not_parent = fields.Boolean("Parent company not set") + exclude_parent = fields.Boolean("Parent company set (Contacts)") + + def _process_query(self, query): + if any([self.exclude_is_company, self.exclude_not_parent, self.exclude_parent]): + filters = [] + if self.exclude_is_company: + filters.append("is_company = False") + if self.exclude_not_parent: + filters.append("parent_id IS NOT NULL") + if self.exclude_parent: + filters.append("parent_id IS NULL") + index_where = query.find("WHERE") + index_group_by = query.find("GROUP BY") + subquery = "%s" % " AND ".join(filters) + if index_where > 0: + subquery = "AND (%s) " % subquery + else: # pragma: no cover + subquery = "WHERE %s " % subquery + query = query[:index_group_by] + subquery + query[index_group_by:] + return super()._process_query(query) diff --git a/partner_deduplicate_filter/wizards/partner_merge_view.xml b/partner_deduplicate_filter/wizards/partner_merge_view.xml new file mode 100644 index 000000000..d4fce2da2 --- /dev/null +++ b/partner_deduplicate_filter/wizards/partner_merge_view.xml @@ -0,0 +1,18 @@ + + + + + base.partner.merge.automatic.wizard + + + + + + + + + + diff --git a/partner_tier_validation/__init__.py b/partner_tier_validation/__init__.py index 31660d6a9..c0d9f3d12 100644 --- a/partner_tier_validation/__init__.py +++ b/partner_tier_validation/__init__.py @@ -1,3 +1,4 @@ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). from . import models +from .hooks import post_init_hook diff --git a/partner_tier_validation/__manifest__.py b/partner_tier_validation/__manifest__.py index 8321c7d0a..7b2ca7f1f 100644 --- a/partner_tier_validation/__manifest__.py +++ b/partner_tier_validation/__manifest__.py @@ -14,4 +14,5 @@ "data/tier_definition.xml", "views/res_partner_view.xml", ], + "post_init_hook": "post_init_hook", } diff --git a/partner_tier_validation/data/tier_definition.xml b/partner_tier_validation/data/tier_definition.xml index 4a5436fa0..528842bca 100644 --- a/partner_tier_validation/data/tier_definition.xml +++ b/partner_tier_validation/data/tier_definition.xml @@ -5,6 +5,7 @@ group domain + ["&",["is_company","=",True],"|",["active","=",True],["active","=",False]] diff --git a/partner_tier_validation/hooks.py b/partner_tier_validation/hooks.py new file mode 100644 index 000000000..0bfebf185 --- /dev/null +++ b/partner_tier_validation/hooks.py @@ -0,0 +1,18 @@ +# Copyright 2021 Tecnativa - Víctor Martínez +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from odoo import SUPERUSER_ID +from odoo.api import Environment +from odoo.tools import config + + +def post_init_hook(cr, pool): + """ + We need to activate the rule only if we are not in a test environment. + """ + if not config["test_enable"]: + env = Environment(cr, SUPERUSER_ID, {}) + tier_partner = env.ref( + "partner_tier_validation.partner_tier_definition_company_only" + ) + tier_partner.write({"active": True}) diff --git a/setup/partner_deduplicate_filter/odoo/addons/partner_deduplicate_filter b/setup/partner_deduplicate_filter/odoo/addons/partner_deduplicate_filter new file mode 120000 index 000000000..ceec5f306 --- /dev/null +++ b/setup/partner_deduplicate_filter/odoo/addons/partner_deduplicate_filter @@ -0,0 +1 @@ +../../../../partner_deduplicate_filter \ No newline at end of file diff --git a/setup/partner_deduplicate_filter/setup.py b/setup/partner_deduplicate_filter/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/partner_deduplicate_filter/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)