Browse Source

[9.0][MIG] crm_deduplicate_by_website module

- Updated README
- Updated views
- Improved tests
12.0
cubells 7 years ago
committed by OCA-git-bot
parent
commit
b85d2fc6af
  1. 3
      partner_deduplicate_by_website/README.rst
  2. 4
      partner_deduplicate_by_website/__openerp__.py
  3. 17
      partner_deduplicate_by_website/tests/test_crm_deduplicate_by_website.py
  4. 7
      partner_deduplicate_by_website/wizards/partner_merge_view.xml

3
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 <pedro.baeza@tecnativa.com>
* Vicent Cubells <vicent.cubells@tecnativa.com>
Maintainer
----------

4
partner_deduplicate_by_website/__openerp__.py

@ -1,10 +1,11 @@
# -*- coding: utf-8 -*-
# Copyright 2016 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# Copyright 2017 Vicent Cubells <vicent.cubells@tecnativa.com>
# 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',

17
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)

7
partner_deduplicate_by_website/wizards/partner_merge_view.xml

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2016 Pedro M. Baeza <pedro.baeza@tecnativa.com>
Copyright 2017 Vicent Cubells <vicent.cubells@tecnativa.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -->
<openerp>
<data>
<odoo>
<record id="base_partner_merge_automatic_wizard_form" model="ir.ui.view">
<field name="model">base.partner.merge.automatic.wizard</field>
@ -18,5 +18,4 @@
</field>
</record>
</data>
</openerp>
</odoo>
Loading…
Cancel
Save