diff --git a/addons/account/models/chart_template.py b/addons/account/models/chart_template.py index ffbcf2bd62cad3519439c10a63419bd4a6c0f801..0d4e1c5f38027baa2166e932665b6a7192ac9fc1 100644 --- a/addons/account/models/chart_template.py +++ b/addons/account/models/chart_template.py @@ -775,18 +775,19 @@ class AccountChartTemplate(models.Model): vals = self._prepare_reconcile_model_vals(company, account_reconcile_model, acc_template_ref, tax_template_ref) self.create_record_with_xmlid(company, account_reconcile_model, 'account.reconcile.model', vals) # Create a default rule for the reconciliation widget matching invoices automatically. - self.env['account.reconcile.model'].sudo().create({ - "name": _('Invoices Matching Rule'), - "sequence": '1', - "rule_type": 'invoice_matching', - "auto_reconcile": False, - "match_nature": 'both', - "match_same_currency": True, - "match_total_amount": True, - "match_total_amount_param": 100, - "match_partner": True, - "company_id": company.id, - }) + if not self.parent_id: + self.env['account.reconcile.model'].sudo().create({ + "name": _('Invoices Matching Rule'), + "sequence": '1', + "rule_type": 'invoice_matching', + "auto_reconcile": False, + "match_nature": 'both', + "match_same_currency": True, + "match_total_amount": True, + "match_total_amount_param": 100, + "match_partner": True, + "company_id": company.id, + }) return True def _get_fp_vals(self, company, position):