diff --git a/partner_deduplicate_acl/README.rst b/partner_deduplicate_acl/README.rst index b4fa43db1..579f3f345 100644 --- a/partner_deduplicate_acl/README.rst +++ b/partner_deduplicate_acl/README.rst @@ -46,7 +46,7 @@ To use this module, you need to: .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/111/10.0 + :target: https://runbot.odoo-community.org/runbot/111/11.0 Known issues / Roadmap ====================== diff --git a/partner_deduplicate_acl/__init__.py b/partner_deduplicate_acl/__init__.py index f8944f05c..ef2bd060e 100644 --- a/partner_deduplicate_acl/__init__.py +++ b/partner_deduplicate_acl/__init__.py @@ -1,4 +1,5 @@ # -*- coding: utf-8 -*- # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +from . import models from . import wizards diff --git a/partner_deduplicate_acl/__manifest__.py b/partner_deduplicate_acl/__manifest__.py index 57588c75e..59c92f7c0 100644 --- a/partner_deduplicate_acl/__manifest__.py +++ b/partner_deduplicate_acl/__manifest__.py @@ -1,13 +1,14 @@ -# -*- coding: utf-8 -*- -# © 2016 Tecnativa, S.L. - Jairo Llopis -# © 2016 Tecnativa, S.L. - Vicent Cubells +# Copyright 2016 Tecnativa - Jairo Llopis +# Copyright 2016 Tecnativa - Vicent Cubells +# Copyright 2017-2018 Tecnativa - Pedro M. Baeza # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + { "name": "Deduplicate Contacts ACL", "summary": "Contact deduplication with fine-grained permission control", - "version": "10.0.1.0.0", + "version": "11.0.1.0.0", "category": "Tools", - "website": "http://www.tecnativa.com", + "website": "https://github.com/OCA/crm", "author": "Tecnativa, " "Odoo Community Association (OCA)", "license": "AGPL-3", diff --git a/partner_deduplicate_acl/i18n/de.po b/partner_deduplicate_acl/i18n/de.po index 7b98634b9..e020f7e89 100644 --- a/partner_deduplicate_acl/i18n/de.po +++ b/partner_deduplicate_acl/i18n/de.po @@ -3,15 +3,14 @@ # * crm_deduplicate_acl # # Translators: -# OCA Transbot , 2016 -# Rudolf Schnapka , 2017 +# OCA Transbot , 2018 msgid "" msgstr "" -"Project-Id-Version: Odoo Server 9.0c\n" +"Project-Id-Version: Odoo Server 11.0\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" +"POT-Creation-Date: 2018-05-03 02:51+0000\n" +"PO-Revision-Date: 2018-05-03 02:51+0000\n" +"Last-Translator: OCA Transbot , 2018\n" "Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -24,6 +23,11 @@ msgstr "" msgid "Automatically" msgstr "Automatisch" +#. module: crm_deduplicate_acl +#: model:ir.model,name:crm_deduplicate_acl.model_res_partner +msgid "Contact" +msgstr "" + #. module: crm_deduplicate_acl #: model:ir.module.category,name:crm_deduplicate_acl.category #: model:ir.ui.menu,name:crm_deduplicate_acl.partner_merge_automatic_menu @@ -36,7 +40,7 @@ msgid "Manually" msgstr "Manuell" #. module: crm_deduplicate_acl -#: model:ir.ui.menu,name:crm_deduplicate_acl.root_menu +#: model:ir.ui.menu,name:crm_deduplicate_acl.crm_tools msgid "Tools" msgstr "Werkzeuge" diff --git a/partner_deduplicate_acl/i18n/es.po b/partner_deduplicate_acl/i18n/es.po index 96646cecf..8e90b872e 100644 --- a/partner_deduplicate_acl/i18n/es.po +++ b/partner_deduplicate_acl/i18n/es.po @@ -3,14 +3,15 @@ # * crm_deduplicate_acl # # Translators: -# OCA Transbot , 2016 +# Pedro M. Baeza , 2018 +# OCA Transbot , 2018 msgid "" msgstr "" -"Project-Id-Version: Odoo Server 9.0c\n" +"Project-Id-Version: Odoo Server 11.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-03-16 03:45+0000\n" -"PO-Revision-Date: 2017-03-16 03:45+0000\n" -"Last-Translator: OCA Transbot , 2016\n" +"POT-Creation-Date: 2018-05-03 02:51+0000\n" +"PO-Revision-Date: 2018-05-03 02:51+0000\n" +"Last-Translator: OCA Transbot , 2018\n" "Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -23,6 +24,11 @@ msgstr "" msgid "Automatically" msgstr "Automáticamente" +#. module: crm_deduplicate_acl +#: model:ir.model,name:crm_deduplicate_acl.model_res_partner +msgid "Contact" +msgstr "Contacto" + #. module: crm_deduplicate_acl #: model:ir.module.category,name:crm_deduplicate_acl.category #: model:ir.ui.menu,name:crm_deduplicate_acl.partner_merge_automatic_menu @@ -35,7 +41,7 @@ msgid "Manually" msgstr "Manualmente" #. module: crm_deduplicate_acl -#: model:ir.ui.menu,name:crm_deduplicate_acl.root_menu +#: model:ir.ui.menu,name:crm_deduplicate_acl.crm_tools msgid "Tools" msgstr "Herramientas" diff --git a/partner_deduplicate_acl/i18n/hr.po b/partner_deduplicate_acl/i18n/hr.po index 2153af29b..c703c5730 100644 --- a/partner_deduplicate_acl/i18n/hr.po +++ b/partner_deduplicate_acl/i18n/hr.po @@ -3,15 +3,14 @@ # * crm_deduplicate_acl # # Translators: -# OCA Transbot , 2017 -# Bole , 2017 +# OCA Transbot , 2018 msgid "" msgstr "" -"Project-Id-Version: Odoo Server 10.0\n" +"Project-Id-Version: Odoo Server 11.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" +"POT-Creation-Date: 2018-05-03 02:51+0000\n" +"PO-Revision-Date: 2018-05-03 02:51+0000\n" +"Last-Translator: OCA Transbot , 2018\n" "Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -19,62 +18,29 @@ msgstr "" "Language: hr\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: crm_deduplicate_acl -#: code:addons/crm_deduplicate_acl/wizards/partner_merge.py:46 -#, python-format -msgid "" -"All contacts must have the same email. Only the Administrator can merge " -"contacts with different emails." -msgstr "" -"Svi kontakti moraju imati isti e-mail, samo administrator može spajati " -"kontakte sa različitim mailovima." - #. module: crm_deduplicate_acl #: model:res.groups,name:crm_deduplicate_acl.group_automatically msgid "Automatically" msgstr "Automatski" +#. module: crm_deduplicate_acl +#: model:ir.model,name:crm_deduplicate_acl.model_res_partner +msgid "Contact" +msgstr "" + #. module: crm_deduplicate_acl #: model:ir.module.category,name:crm_deduplicate_acl.category #: model:ir.ui.menu,name:crm_deduplicate_acl.partner_merge_automatic_menu msgid "Deduplicate Contacts" msgstr "Ukloni duple kontakte" -#. module: crm_deduplicate_acl -#: code:addons/crm_deduplicate_acl/wizards/partner_merge.py:28 -#, python-format -msgid "" -"For safety reasons, you cannot merge more than 3 contacts together. You can " -"re-open the wizard several times if needed." -msgstr "" -"Iz sigurnosnih razloga nije moguće spajati više od 3 kontakta. Možete " -"pokrenuti čarobnjaka za spajanje više puta ukoliko je potrebno." - #. module: crm_deduplicate_acl #: model:res.groups,name:crm_deduplicate_acl.group_manually msgid "Manually" msgstr "Ručno" #. module: crm_deduplicate_acl -#: code:addons/crm_deduplicate_acl/wizards/partner_merge.py:81 -#, python-format -msgid "Merged with the following partners:" -msgstr "Spojen sa sljedećim partnerima:" - -#. module: crm_deduplicate_acl -#: code:addons/crm_deduplicate_acl/wizards/partner_merge.py:69 -#, python-format -msgid "" -"Only the destination contact may be linked to existing Journal Items. Please" -" ask the Administrator if you need to merge several contacts linked to " -"existing Journal Items." -msgstr "" -"Samo odredišni kontakt može biti povezan sa postojećim stavkama dnevnika. " -"Molimo zamolite administratora ukoliko je potrebno spojiti nekoliko " -"kontakata povezanih sa postojećim stavkama dnevnika." - -#. module: crm_deduplicate_acl -#: model:ir.ui.menu,name:crm_deduplicate_acl.root_menu +#: model:ir.ui.menu,name:crm_deduplicate_acl.crm_tools msgid "Tools" msgstr "Alati" @@ -83,12 +49,6 @@ msgstr "Alati" msgid "Without restrictions" msgstr "Bez ograničenja" -#. module: crm_deduplicate_acl -#: code:addons/crm_deduplicate_acl/wizards/partner_merge.py:38 -#, python-format -msgid "You cannot merge a contact with one of his parent." -msgstr "Nije moguće spojiti kontakt sa svojim nadređenim." - #. module: crm_deduplicate_acl #: model:ir.model,name:crm_deduplicate_acl.model_base_partner_merge_automatic_wizard msgid "base.partner.merge.automatic.wizard" diff --git a/partner_deduplicate_acl/i18n/nl_NL.po b/partner_deduplicate_acl/i18n/nl_NL.po index aaf3cf59b..c470aa387 100644 --- a/partner_deduplicate_acl/i18n/nl_NL.po +++ b/partner_deduplicate_acl/i18n/nl_NL.po @@ -3,14 +3,14 @@ # * crm_deduplicate_acl # # Translators: -# Peter Hageman , 2017 +# OCA Transbot , 2018 msgid "" msgstr "" -"Project-Id-Version: Odoo Server 10.0\n" +"Project-Id-Version: Odoo Server 11.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-12-04 15:47+0000\n" -"PO-Revision-Date: 2017-12-04 15:47+0000\n" -"Last-Translator: Peter Hageman , 2017\n" +"POT-Creation-Date: 2018-05-03 02:51+0000\n" +"PO-Revision-Date: 2018-05-03 02:51+0000\n" +"Last-Translator: OCA Transbot , 2018\n" "Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/teams/23907/nl_NL/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -18,55 +18,29 @@ msgstr "" "Language: nl_NL\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#. module: crm_deduplicate_acl -#: code:addons/crm_deduplicate_acl/wizards/partner_merge.py:46 -#, python-format -msgid "" -"All contacts must have the same email. Only the Administrator can merge " -"contacts with different emails." -msgstr "" - #. module: crm_deduplicate_acl #: model:res.groups,name:crm_deduplicate_acl.group_automatically msgid "Automatically" msgstr "Automatisch" +#. module: crm_deduplicate_acl +#: model:ir.model,name:crm_deduplicate_acl.model_res_partner +msgid "Contact" +msgstr "" + #. module: crm_deduplicate_acl #: model:ir.module.category,name:crm_deduplicate_acl.category #: model:ir.ui.menu,name:crm_deduplicate_acl.partner_merge_automatic_menu msgid "Deduplicate Contacts" msgstr "Ontdubbel Relaties" -#. module: crm_deduplicate_acl -#: code:addons/crm_deduplicate_acl/wizards/partner_merge.py:28 -#, python-format -msgid "" -"For safety reasons, you cannot merge more than 3 contacts together. You can " -"re-open the wizard several times if needed." -msgstr "" - #. module: crm_deduplicate_acl #: model:res.groups,name:crm_deduplicate_acl.group_manually msgid "Manually" msgstr "Handmatig" #. module: crm_deduplicate_acl -#: code:addons/crm_deduplicate_acl/wizards/partner_merge.py:81 -#, python-format -msgid "Merged with the following partners:" -msgstr "Samengevoegd met de volgende contacten:" - -#. module: crm_deduplicate_acl -#: code:addons/crm_deduplicate_acl/wizards/partner_merge.py:69 -#, python-format -msgid "" -"Only the destination contact may be linked to existing Journal Items. Please" -" ask the Administrator if you need to merge several contacts linked to " -"existing Journal Items." -msgstr "" - -#. module: crm_deduplicate_acl -#: model:ir.ui.menu,name:crm_deduplicate_acl.root_menu +#: model:ir.ui.menu,name:crm_deduplicate_acl.crm_tools msgid "Tools" msgstr "" @@ -75,12 +49,6 @@ msgstr "" msgid "Without restrictions" msgstr "Zonder beperkingen" -#. module: crm_deduplicate_acl -#: code:addons/crm_deduplicate_acl/wizards/partner_merge.py:38 -#, python-format -msgid "You cannot merge a contact with one of his parent." -msgstr "Je kan geen relatie samenvoegen met één van haar ouders." - #. module: crm_deduplicate_acl #: model:ir.model,name:crm_deduplicate_acl.model_base_partner_merge_automatic_wizard msgid "base.partner.merge.automatic.wizard" diff --git a/partner_deduplicate_acl/i18n/pt_BR.po b/partner_deduplicate_acl/i18n/pt_BR.po index 82054b8cb..7a9a7c350 100644 --- a/partner_deduplicate_acl/i18n/pt_BR.po +++ b/partner_deduplicate_acl/i18n/pt_BR.po @@ -3,15 +3,15 @@ # * crm_deduplicate_acl # # Translators: -# OCA Transbot , 2017 -# falexandresilva , 2017 +# falexandresilva , 2018 +# OCA Transbot , 2018 msgid "" msgstr "" -"Project-Id-Version: Odoo Server 10.0\n" +"Project-Id-Version: Odoo Server 11.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-06-19 02:41+0000\n" -"PO-Revision-Date: 2017-06-19 02:41+0000\n" -"Last-Translator: falexandresilva , 2017\n" +"POT-Creation-Date: 2018-05-03 02:51+0000\n" +"PO-Revision-Date: 2018-05-03 02:51+0000\n" +"Last-Translator: OCA Transbot , 2018\n" "Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/teams/23907/pt_BR/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -19,55 +19,29 @@ msgstr "" "Language: pt_BR\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#. module: crm_deduplicate_acl -#: code:addons/crm_deduplicate_acl/wizards/partner_merge.py:46 -#, python-format -msgid "" -"All contacts must have the same email. Only the Administrator can merge " -"contacts with different emails." -msgstr "" - #. module: crm_deduplicate_acl #: model:res.groups,name:crm_deduplicate_acl.group_automatically msgid "Automatically" msgstr "Automaticamente" +#. module: crm_deduplicate_acl +#: model:ir.model,name:crm_deduplicate_acl.model_res_partner +msgid "Contact" +msgstr "Contato" + #. module: crm_deduplicate_acl #: model:ir.module.category,name:crm_deduplicate_acl.category #: model:ir.ui.menu,name:crm_deduplicate_acl.partner_merge_automatic_menu msgid "Deduplicate Contacts" msgstr "Deduplicar contatos" -#. module: crm_deduplicate_acl -#: code:addons/crm_deduplicate_acl/wizards/partner_merge.py:28 -#, python-format -msgid "" -"For safety reasons, you cannot merge more than 3 contacts together. You can " -"re-open the wizard several times if needed." -msgstr "" - #. module: crm_deduplicate_acl #: model:res.groups,name:crm_deduplicate_acl.group_manually msgid "Manually" msgstr "Manualmente" #. module: crm_deduplicate_acl -#: code:addons/crm_deduplicate_acl/wizards/partner_merge.py:81 -#, python-format -msgid "Merged with the following partners:" -msgstr "" - -#. module: crm_deduplicate_acl -#: code:addons/crm_deduplicate_acl/wizards/partner_merge.py:69 -#, python-format -msgid "" -"Only the destination contact may be linked to existing Journal Items. Please" -" ask the Administrator if you need to merge several contacts linked to " -"existing Journal Items." -msgstr "" - -#. module: crm_deduplicate_acl -#: model:ir.ui.menu,name:crm_deduplicate_acl.root_menu +#: model:ir.ui.menu,name:crm_deduplicate_acl.crm_tools msgid "Tools" msgstr "Ferramentas" @@ -76,12 +50,6 @@ msgstr "Ferramentas" msgid "Without restrictions" msgstr "Sem restrições" -#. module: crm_deduplicate_acl -#: code:addons/crm_deduplicate_acl/wizards/partner_merge.py:38 -#, python-format -msgid "You cannot merge a contact with one of his parent." -msgstr "" - #. module: crm_deduplicate_acl #: model:ir.model,name:crm_deduplicate_acl.model_base_partner_merge_automatic_wizard msgid "base.partner.merge.automatic.wizard" diff --git a/partner_deduplicate_acl/i18n/sk.po b/partner_deduplicate_acl/i18n/sk.po index 1f7f603ea..72785fed7 100644 --- a/partner_deduplicate_acl/i18n/sk.po +++ b/partner_deduplicate_acl/i18n/sk.po @@ -3,14 +3,14 @@ # * crm_deduplicate_acl # # Translators: -# gebri , 2016 +# OCA Transbot , 2018 msgid "" msgstr "" -"Project-Id-Version: Odoo Server 9.0c\n" +"Project-Id-Version: Odoo Server 11.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-12-17 01:29+0000\n" -"PO-Revision-Date: 2016-12-17 01:29+0000\n" -"Last-Translator: gebri , 2016\n" +"POT-Creation-Date: 2018-05-03 02:51+0000\n" +"PO-Revision-Date: 2018-05-03 02:51+0000\n" +"Last-Translator: OCA Transbot , 2018\n" "Language-Team: Slovak (https://www.transifex.com/oca/teams/23907/sk/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -23,6 +23,11 @@ msgstr "" msgid "Automatically" msgstr "Automaticky" +#. module: crm_deduplicate_acl +#: model:ir.model,name:crm_deduplicate_acl.model_res_partner +msgid "Contact" +msgstr "" + #. module: crm_deduplicate_acl #: model:ir.module.category,name:crm_deduplicate_acl.category #: model:ir.ui.menu,name:crm_deduplicate_acl.partner_merge_automatic_menu @@ -35,7 +40,7 @@ msgid "Manually" msgstr "Manuálne" #. module: crm_deduplicate_acl -#: model:ir.ui.menu,name:crm_deduplicate_acl.root_menu +#: model:ir.ui.menu,name:crm_deduplicate_acl.crm_tools msgid "Tools" msgstr "Nástroje" diff --git a/partner_deduplicate_acl/i18n/sl.po b/partner_deduplicate_acl/i18n/sl.po index 9176ba2c2..bf55f62cd 100644 --- a/partner_deduplicate_acl/i18n/sl.po +++ b/partner_deduplicate_acl/i18n/sl.po @@ -3,15 +3,14 @@ # * crm_deduplicate_acl # # Translators: -# OCA Transbot , 2016 -# Matjaž Mozetič , 2016 +# OCA Transbot , 2018 msgid "" msgstr "" -"Project-Id-Version: Odoo Server 9.0c\n" +"Project-Id-Version: Odoo Server 11.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-12-07 03:39+0000\n" -"PO-Revision-Date: 2016-12-07 03:39+0000\n" -"Last-Translator: Matjaž Mozetič , 2016\n" +"POT-Creation-Date: 2018-05-03 02:51+0000\n" +"PO-Revision-Date: 2018-05-03 02:51+0000\n" +"Last-Translator: OCA Transbot , 2018\n" "Language-Team: Slovenian (https://www.transifex.com/oca/teams/23907/sl/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -24,6 +23,11 @@ msgstr "" msgid "Automatically" msgstr "Samodejno" +#. module: crm_deduplicate_acl +#: model:ir.model,name:crm_deduplicate_acl.model_res_partner +msgid "Contact" +msgstr "" + #. module: crm_deduplicate_acl #: model:ir.module.category,name:crm_deduplicate_acl.category #: model:ir.ui.menu,name:crm_deduplicate_acl.partner_merge_automatic_menu @@ -36,7 +40,7 @@ msgid "Manually" msgstr "Ročno" #. module: crm_deduplicate_acl -#: model:ir.ui.menu,name:crm_deduplicate_acl.root_menu +#: model:ir.ui.menu,name:crm_deduplicate_acl.crm_tools msgid "Tools" msgstr "Orodja" diff --git a/partner_deduplicate_acl/i18n/tr.po b/partner_deduplicate_acl/i18n/tr.po index 66140f1bf..6aa5078d8 100644 --- a/partner_deduplicate_acl/i18n/tr.po +++ b/partner_deduplicate_acl/i18n/tr.po @@ -3,15 +3,14 @@ # * crm_deduplicate_acl # # Translators: -# OCA Transbot , 2017 -# Ediz Duman , 2017 +# OCA Transbot , 2018 msgid "" msgstr "" -"Project-Id-Version: Odoo Server 10.0\n" +"Project-Id-Version: Odoo Server 11.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" +"POT-Creation-Date: 2018-05-03 02:51+0000\n" +"PO-Revision-Date: 2018-05-03 02:51+0000\n" +"Last-Translator: OCA Transbot , 2018\n" "Language-Team: Turkish (https://www.transifex.com/oca/teams/23907/tr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -19,57 +18,29 @@ msgstr "" "Language: tr\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#. module: crm_deduplicate_acl -#: code:addons/crm_deduplicate_acl/wizards/partner_merge.py:46 -#, python-format -msgid "" -"All contacts must have the same email. Only the Administrator can merge " -"contacts with different emails." -msgstr "" - #. module: crm_deduplicate_acl #: model:res.groups,name:crm_deduplicate_acl.group_automatically msgid "Automatically" msgstr "Otomatikman" +#. module: crm_deduplicate_acl +#: model:ir.model,name:crm_deduplicate_acl.model_res_partner +msgid "Contact" +msgstr "" + #. module: crm_deduplicate_acl #: model:ir.module.category,name:crm_deduplicate_acl.category #: model:ir.ui.menu,name:crm_deduplicate_acl.partner_merge_automatic_menu msgid "Deduplicate Contacts" msgstr "Çift Kayıtlı Kontakları Birleştir" -#. module: crm_deduplicate_acl -#: code:addons/crm_deduplicate_acl/wizards/partner_merge.py:28 -#, python-format -msgid "" -"For safety reasons, you cannot merge more than 3 contacts together. You can " -"re-open the wizard several times if needed." -msgstr "" -"Güvenlik nedeniyle, en fazla 3 kişiyi birleştirebilirsiniz. Gerekirse birkaç" -" kez sihirbazını yeniden açabilirsiniz." - #. module: crm_deduplicate_acl #: model:res.groups,name:crm_deduplicate_acl.group_manually msgid "Manually" msgstr "Manuel" #. module: crm_deduplicate_acl -#: code:addons/crm_deduplicate_acl/wizards/partner_merge.py:81 -#, python-format -msgid "Merged with the following partners:" -msgstr "Aşağıdaki iş ortaklarla birleştirildi:" - -#. module: crm_deduplicate_acl -#: code:addons/crm_deduplicate_acl/wizards/partner_merge.py:69 -#, python-format -msgid "" -"Only the destination contact may be linked to existing Journal Items. Please" -" ask the Administrator if you need to merge several contacts linked to " -"existing Journal Items." -msgstr "" - -#. module: crm_deduplicate_acl -#: model:ir.ui.menu,name:crm_deduplicate_acl.root_menu +#: model:ir.ui.menu,name:crm_deduplicate_acl.crm_tools msgid "Tools" msgstr "Araçlar" @@ -78,12 +49,6 @@ msgstr "Araçlar" msgid "Without restrictions" msgstr "Kısıtlama olmaksızın" -#. module: crm_deduplicate_acl -#: code:addons/crm_deduplicate_acl/wizards/partner_merge.py:38 -#, python-format -msgid "You cannot merge a contact with one of his parent." -msgstr "Bir kontağın kendi üst kontağı ile birleştiremezsiniz." - #. module: crm_deduplicate_acl #: model:ir.model,name:crm_deduplicate_acl.model_base_partner_merge_automatic_wizard msgid "base.partner.merge.automatic.wizard" diff --git a/partner_deduplicate_acl/models/__init__.py b/partner_deduplicate_acl/models/__init__.py new file mode 100644 index 000000000..ccebc7247 --- /dev/null +++ b/partner_deduplicate_acl/models/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import res_partner diff --git a/partner_deduplicate_acl/models/res_partner.py b/partner_deduplicate_acl/models/res_partner.py new file mode 100644 index 000000000..2d9f246f9 --- /dev/null +++ b/partner_deduplicate_acl/models/res_partner.py @@ -0,0 +1,16 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import api, models + + +class ResPartner(models.Model): + _inherit = 'res.partner' + + @api.returns('self', lambda value: value.id) + def message_post(self, *args, **kwargs): + """Change user who is posting the message if set by context.""" + if self.env.context.get('message_post_user'): + obj = self.sudo(self.env.context['message_post_user']) + else: + obj = self + return super(ResPartner, obj).message_post(*args, **kwargs) diff --git a/partner_deduplicate_acl/tests/__init__.py b/partner_deduplicate_acl/tests/__init__.py new file mode 100644 index 000000000..10d77771a --- /dev/null +++ b/partner_deduplicate_acl/tests/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import test_crm_deduplicate_acl diff --git a/partner_deduplicate_acl/tests/test_crm_deduplicate_acl.py b/partner_deduplicate_acl/tests/test_crm_deduplicate_acl.py new file mode 100644 index 000000000..4c0da683d --- /dev/null +++ b/partner_deduplicate_acl/tests/test_crm_deduplicate_acl.py @@ -0,0 +1,50 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import exceptions +from odoo.tests import common + + +class TestCrmDeduplicateAcl(common.TransactionCase): + def setUp(self): + super(TestCrmDeduplicateAcl, self).setUp() + self.partner_1 = self.env['res.partner'].create({ + 'name': 'Partner 1', + 'email': 'partner1@example.org', + 'is_company': True, + 'parent_id': False, + }) + self.partner_2 = self.partner_1.copy() + self.partner_2.write({ + 'name': 'Partner 1', + 'email': 'partner2@example.org' + }) + self.user = self.env['res.users'].create({ + 'login': 'test_crm_deduplicate_acl', + 'name': 'test_crm_deduplicate_acl', + 'email': 'crm_deduplicate_acl@example.org', + 'groups_id': [ + (4, self.env.ref('base.group_user').id), + (4, self.env.ref('base.group_partner_manager').id), + ] + }) + self.wizard = self.env['base.partner.merge.automatic.wizard'].sudo( + self.user, + ).create({ + 'group_by_name': True, + }) + + def test_same_email_restriction(self): + self.wizard.action_start_manual_process() + with self.assertRaises(exceptions.UserError): + self.wizard.action_merge() + self.user.groups_id = [ + (4, self.env.ref('crm_deduplicate_acl.group_unrestricted').id), + ] + # Now there shouldn't be error + self.wizard.action_merge() + # Check that the posted message has correct user + resulting_partner = (self.partner_1 + self.partner_2).exists() + self.assertEqual( + resulting_partner.message_ids[0].author_id, + self.user.partner_id, + ) diff --git a/partner_deduplicate_acl/views/base_partner_merge_view.xml b/partner_deduplicate_acl/views/base_partner_merge_view.xml index 5d43b1ca1..f9fb03dab 100644 --- a/partner_deduplicate_acl/views/base_partner_merge_view.xml +++ b/partner_deduplicate_acl/views/base_partner_merge_view.xml @@ -4,11 +4,11 @@ Copyright 2017 Tecnativa - Pedro M. Baeza License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). --> - + diff --git a/partner_deduplicate_acl/wizards/__init__.py b/partner_deduplicate_acl/wizards/__init__.py index 31a70707d..fa92260c9 100644 --- a/partner_deduplicate_acl/wizards/__init__.py +++ b/partner_deduplicate_acl/wizards/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import partner_merge diff --git a/partner_deduplicate_acl/wizards/partner_merge.py b/partner_deduplicate_acl/wizards/partner_merge.py index dd0227d6f..e02dee836 100644 --- a/partner_deduplicate_acl/wizards/partner_merge.py +++ b/partner_deduplicate_acl/wizards/partner_merge.py @@ -1,87 +1,27 @@ -# -*- coding: utf-8 -*- -# © 2016 Tecnativa, S.L. - Jairo Llopis -# © 2016 Tecnativa, S.L. - Vicent Cubells +# Copyright 2016 Tecnativa - Jairo Llopis +# Copyright 2016 Tecnativa - Vicent Cubells +# Copyright 2017 Tecnativa - Pedro M. Baeza # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from odoo import _, SUPERUSER_ID, models -from odoo.exceptions import UserError -import logging - - -_logger = logging.getLogger('base.partner.merge') +from odoo import models class BasePartnerMergeAutomaticWizard(models.TransientModel): _inherit = "base.partner.merge.automatic.wizard" def _merge(self, partner_ids, dst_partner=None): - """ private implementation of merge partner - :param partner_ids : ids of partner to merge - :param dst_partner : record of destination res.partner + """Perform the operation as admin if you have unrestricted merge + rights to avoid the rise of exceptions. An special context key is + passed for preserving the message author. """ - Partner = self.env['res.partner'] - partner_ids = Partner.browse(partner_ids).exists() - if len(partner_ids) < 2: - return - - if len(partner_ids) > 3: - raise UserError(_("For safety reasons, you cannot merge more than" - " 3 contacts together. You can re-open" - " the wizard several times if needed.")) - - # check if the list of partners to merge contains child/parent relation - child_ids = self.env['res.partner'] - for partner_id in partner_ids: - child_ids |= Partner.search( - [('id', 'child_of', [partner_id.id])]) - partner_id - if partner_ids & child_ids: - raise UserError(_("You cannot merge a contact with one" - " of his parent.")) - - user = self.env.user - - if SUPERUSER_ID != self.env.uid and not user.has_group( - 'crm_deduplicate_acl.group_unrestricted') and\ - len(set(partner.email for partner in partner_ids)) > 1: - raise UserError(_("All contacts must have the same email." - " Only the Administrator can merge contacts" - " with different emails.")) - - # remove dst_partner from partners to merge - if dst_partner and dst_partner in partner_ids: - src_partners = partner_ids - dst_partner + if self.env.user.has_group('crm_deduplicate_acl.group_unrestricted'): + obj = self.sudo().with_context(message_post_user=self.env.uid) + if dst_partner: + dst_partner = dst_partner.with_context( + message_post_user=self.env.uid, + ) else: - ordered_partners = self._get_ordered_partner(partner_ids.ids) - dst_partner = ordered_partners[-1] - src_partners = ordered_partners[:-1] - _logger.info("dst_partner: %s", dst_partner.id) - - # FIXME: is it still required to make and exception for - # account.move.line since accounting v9.0 ? - if SUPERUSER_ID != self.env.uid and not user.has_group( - 'crm_deduplicate_acl.group_unrestricted') and\ - 'account.move.line' in self.env and\ - self.env[ - 'account.move.line' - ].sudo().search([('partner_id', 'in', [partner.id for - partner in src_partners - ])]): - raise UserError(_("Only the destination contact may be linked to" - " existing Journal Items. Please ask the" - " Administrator if you need to merge several" - " contacts linked to existing Journal Items.")) - - # call sub methods to do the merge - self._update_foreign_keys(src_partners, dst_partner) - self._update_reference_fields(src_partners, dst_partner) - self._update_values(src_partners, dst_partner) - - _logger.info('(uid = %s) merged the partners %r with %s', - self._uid, src_partners.ids, dst_partner.id) - dst_partner.message_post(body='%s %s' % (_( - "Merged with the following partners:"), ", ".join( - '%s <%s> (ID %s)' % (p.name, p.email or 'n/a', p.id) - for p in src_partners))) - - # delete source partner, since they are merged - src_partners.unlink() + obj = self + return super(BasePartnerMergeAutomaticWizard, obj)._merge( + partner_ids, dst_partner=dst_partner, + ) diff --git a/partner_deduplicate_acl/wizards/partner_merge_view.xml b/partner_deduplicate_acl/wizards/partner_merge_view.xml index ed0839ba3..3ac3588cc 100644 --- a/partner_deduplicate_acl/wizards/partner_merge_view.xml +++ b/partner_deduplicate_acl/wizards/partner_merge_view.xml @@ -1,6 +1,7 @@ - @@ -19,7 +20,7 @@ - group_manually +