From 279434032c483c42f0ed5af2c833fd0d2a55d62e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Mart=C3=ADnez?= Date: Mon, 19 Apr 2021 13:00:12 +0200 Subject: [PATCH] [FIX] mass_mailing_partner: Add sudo() to prevent user without mailing access try to merge contacts --- mass_mailing_partner/wizard/partner_merge.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mass_mailing_partner/wizard/partner_merge.py b/mass_mailing_partner/wizard/partner_merge.py index e115473..97116cc 100644 --- a/mass_mailing_partner/wizard/partner_merge.py +++ b/mass_mailing_partner/wizard/partner_merge.py @@ -9,8 +9,10 @@ class BasePartnerMergeAutomaticWizard(models.TransientModel): def _merge(self, partner_ids, dst_partner=None, extra_checks=True): if dst_partner: - contacts = self.env["mailing.contact"].search( - [("partner_id", "in", partner_ids)] + contacts = ( + self.env["mailing.contact"] + .sudo() + .search([("partner_id", "in", partner_ids)]) ) if contacts: contacts = contacts.sorted(