From 93e0539a37d01b7cde9214307e7c566f19a322d6 Mon Sep 17 00:00:00 2001 From: Irving Daniel Reyes Elizondo Date: Mon, 8 Dec 2025 15:51:33 +0000 Subject: [PATCH] [IMP] base: allow bypass validation for merging with more than 3 partners Currently the mergings of partner cannot be done if the partners to merge are more than 3, in proposals of Deduplication rules, the groups can be more than 3 partners and the error is stopping the cron job. --- odoo/addons/base/wizard/base_partner_merge.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/odoo/addons/base/wizard/base_partner_merge.py b/odoo/addons/base/wizard/base_partner_merge.py index c1c1cad6773d3..303d0233fcf85 100644 --- a/odoo/addons/base/wizard/base_partner_merge.py +++ b/odoo/addons/base/wizard/base_partner_merge.py @@ -386,6 +386,8 @@ def _merge(self, partner_ids, dst_partner=None, extra_checks=True): :param dst_partner : record of destination res.partner :param extra_checks: pass False to bypass extra sanity check (e.g. email address) """ + # This context is used to don't show errors, only in loggers to allow continue from the cron job + skip_raise_errors = self._context.get("skip_validation_merging_more_contacts_together", False) # super-admin can be used to bypass extra checks if self.env.is_admin(): extra_checks = False @@ -395,7 +397,7 @@ def _merge(self, partner_ids, dst_partner=None, extra_checks=True): if len(partner_ids) < 2: return - if len(partner_ids) > 3: + if len(partner_ids) > 3 and not skip_raise_errors: raise UserError(_("For safety reasons, you cannot merge more than 3 contacts together. You can re-open the wizard several times if needed.")) # check if the list of partners to merge contains child/parent relation