[FIX] mass_mailing_partner: Add sudo() to prevent user without mailing access try to merge contacts

This commit is contained in:
Víctor Martínez 2021-04-19 13:00:12 +02:00 committed by emagdalenaC2i
parent 0c8846182d
commit 279434032c

View File

@ -9,8 +9,10 @@ class BasePartnerMergeAutomaticWizard(models.TransientModel):
def _merge(self, partner_ids, dst_partner=None, extra_checks=True): def _merge(self, partner_ids, dst_partner=None, extra_checks=True):
if dst_partner: if dst_partner:
contacts = self.env["mailing.contact"].search( contacts = (
[("partner_id", "in", partner_ids)] self.env["mailing.contact"]
.sudo()
.search([("partner_id", "in", partner_ids)])
) )
if contacts: if contacts:
contacts = contacts.sorted( contacts = contacts.sorted(