diff --git a/partner_deduplicate_by_website/README.rst b/partner_deduplicate_by_website/README.rst index 58ea0d56d..0406eeeb9 100644 --- a/partner_deduplicate_by_website/README.rst +++ b/partner_deduplicate_by_website/README.rst @@ -21,7 +21,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/8.0 + :target: https://runbot.odoo-community.org/runbot/111/9.0 Bug Tracker =========== @@ -43,6 +43,7 @@ Contributors ------------ * Pedro M. Baeza +* Vicent Cubells Maintainer ---------- diff --git a/partner_deduplicate_by_website/__openerp__.py b/partner_deduplicate_by_website/__openerp__.py index 811dc48f1..01983176d 100644 --- a/partner_deduplicate_by_website/__openerp__.py +++ b/partner_deduplicate_by_website/__openerp__.py @@ -1,10 +1,11 @@ # -*- coding: utf-8 -*- # Copyright 2016 Pedro M. Baeza +# Copyright 2017 Vicent Cubells # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { "name": "Deduplicate Contacts by Website", - "version": "8.0.1.0.0", + "version": "9.0.1.0.0", "category": "Tools", "website": "https://www.tecnativa.com", "author": "Tecnativa, " @@ -13,6 +14,7 @@ "installable": True, "depends": [ "crm", + "crm_deduplicate_acl", ], "data": [ 'wizards/partner_merge_view.xml', diff --git a/partner_deduplicate_by_website/tests/test_crm_deduplicate_by_website.py b/partner_deduplicate_by_website/tests/test_crm_deduplicate_by_website.py index e34e1f0f6..316b3946c 100644 --- a/partner_deduplicate_by_website/tests/test_crm_deduplicate_by_website.py +++ b/partner_deduplicate_by_website/tests/test_crm_deduplicate_by_website.py @@ -12,10 +12,12 @@ class TestDeduplicateByWebsite(common.TransactionCase): self.partner_1 = self.env['res.partner'].create({ 'name': 'Partner 1', 'website': 'www.test-deduplicate.com', + 'email': 'test@deduplicate.com', }) self.partner_2 = self.env['res.partner'].create({ 'name': 'Partner 2', 'website': 'www.test-deduplicate.com', + 'email': 'test@deduplicate.com', }) def test_deduplicate_by_website(self): @@ -31,3 +33,18 @@ class TestDeduplicateByWebsite(common.TransactionCase): found_match = True break self.assertTrue(found_match) + + def test_deduplicate_by_website_and_is_company(self): + wizard = self.env['base.partner.merge.automatic.wizard'].create({ + 'group_by_website': True, + 'group_by_email': True, + }) + wizard.start_process_cb() + found_match = False + for line in wizard.line_ids: + match_ids = safe_eval(line.aggr_ids) + if (self.partner_1.id in match_ids and + self.partner_2.id in match_ids): + found_match = True + break + self.assertTrue(found_match) diff --git a/partner_deduplicate_by_website/wizards/partner_merge_view.xml b/partner_deduplicate_by_website/wizards/partner_merge_view.xml index ad081ac89..e2d1fac26 100644 --- a/partner_deduplicate_by_website/wizards/partner_merge_view.xml +++ b/partner_deduplicate_by_website/wizards/partner_merge_view.xml @@ -1,9 +1,9 @@ - - + base.partner.merge.automatic.wizard @@ -18,5 +18,4 @@ - - +