diff --git a/partner_deduplicate_acl/README.rst b/partner_deduplicate_acl/README.rst index b0df5b7ec..61c0be42e 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/8.0 + :target: https://runbot.odoo-community.org/runbot/111/9.0 Known issues / Roadmap ====================== @@ -60,11 +60,7 @@ 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 -`_. +help us smashing it by providing a detailed and welcomed feedback. Credits ======= @@ -72,6 +68,7 @@ Credits Images ------ +* Odoo Community Association: `Icon `_. * `Arrow `_. * `Lock `_. @@ -80,6 +77,7 @@ Contributors * Rafael Blasco * Jairo Llopis +* Vicent Cubells Maintainer ---------- diff --git a/partner_deduplicate_acl/__init__.py b/partner_deduplicate_acl/__init__.py index a803d44dd..e2a6315db 100644 --- a/partner_deduplicate_acl/__init__.py +++ b/partner_deduplicate_acl/__init__.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- -# © 2016 Antiun Ingeniería S.L. - Jairo Llopis +# © 2016 Tecnativa, S.L. - Jairo Llopis +# © 2016 Tecnativa, S.L. - Vicent Cubells # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import wizards diff --git a/partner_deduplicate_acl/__openerp__.py b/partner_deduplicate_acl/__openerp__.py index 76d2e015b..c62c0f161 100644 --- a/partner_deduplicate_acl/__openerp__.py +++ b/partner_deduplicate_acl/__openerp__.py @@ -1,13 +1,15 @@ # -*- coding: utf-8 -*- -# © 2016 Antiun Ingeniería S.L. - Jairo Llopis +# © 2016 Tecnativa, S.L. - Jairo Llopis +# © 2016 Tecnativa, S.L. - Vicent Cubells # 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": "8.0.1.0.0", + "version": "9.0.1.0.0", "category": "Tools", - "website": "http://www.antiun.com", - "author": "Antiun Ingeniería S.L., Odoo Community Association (OCA)", + "website": "http://www.tecnativa.com", + "author": "Tecnativa, " + "Odoo Community Association (OCA)", "license": "AGPL-3", "application": False, "installable": True, diff --git a/partner_deduplicate_acl/security/crm_deduplicate_acl_security.xml b/partner_deduplicate_acl/security/crm_deduplicate_acl_security.xml index e4338d619..7c0f0f87c 100644 --- a/partner_deduplicate_acl/security/crm_deduplicate_acl_security.xml +++ b/partner_deduplicate_acl/security/crm_deduplicate_acl_security.xml @@ -1,44 +1,35 @@ - - - - - - - - Deduplicate Contacts - - - - - Manually - - - - - Automatically - - - - - - Without restrictions - - - - - - - - - - - - - - - - + + + + + Deduplicate Contacts + + + + + Manually + + + + + Automatically + + + + + + Without restrictions + + + + + + + + + + diff --git a/partner_deduplicate_acl/wizards/__init__.py b/partner_deduplicate_acl/wizards/__init__.py index c93eadfed..823838c11 100644 --- a/partner_deduplicate_acl/wizards/__init__.py +++ b/partner_deduplicate_acl/wizards/__init__.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- -# © 2016 Antiun Ingeniería S.L. - Jairo Llopis +# © 2016 Tecnativa, S.L. - Jairo Llopis +# © 2016 Tecnativa, S.L. - Vicent Cubells # 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 babd38527..1b89a1aca 100644 --- a/partner_deduplicate_acl/wizards/partner_merge.py +++ b/partner_deduplicate_acl/wizards/partner_merge.py @@ -1,25 +1,21 @@ # -*- coding: utf-8 -*- -# © 2016 Antiun Ingeniería S.L. - Jairo Llopis +# © 2016 Tecnativa, S.L. - Jairo Llopis +# © 2016 Tecnativa, S.L. - Vicent Cubells # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp import SUPERUSER_ID, api, models +from openerp import api, models class BasePartnerMergeAutomaticWizard(models.TransientModel): _inherit = "base.partner.merge.automatic.wizard" - @api.cr_uid_context - def _merge(self, cr, uid, partner_ids, dst_partner=None, context=None): + @api.model + def _merge(self, partner_ids, dst_partner=None): """Allow non-admins to merge partners with different emails.""" # Know if user has unrestricted access - group_unrestricted = self.pool["ir.model.data"].xmlid_to_object( - cr, uid, "crm_deduplicate_acl.group_unrestricted", context) - user = self.pool["res.users"].browse(cr, uid, uid, context) - - # Run as admin if so + if self.env.user.has_group('crm_deduplicate_acl.group_unrestricted'): + # Run as admin if so + self = self.sudo() return super(BasePartnerMergeAutomaticWizard, self)._merge( - cr, - SUPERUSER_ID if group_unrestricted in user.groups_id else uid, - partner_ids, - dst_partner, - context) + partner_ids=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 fa53913ca..c4a556cc7 100644 --- a/partner_deduplicate_acl/wizards/partner_merge_view.xml +++ b/partner_deduplicate_acl/wizards/partner_merge_view.xml @@ -1,9 +1,8 @@ - - - - + Restrict automatic merge access @@ -23,5 +22,4 @@ group_manually - - +