Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion odoo/addons/base/wizard/base_partner_merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down