From b4c498684c01467535614a4b439964052faaebee Mon Sep 17 00:00:00 2001 From: Enric Tobella Date: Fri, 15 May 2020 10:45:06 +0200 Subject: [PATCH] [12.0][FIX] account_banking_mandate: Set Force company --- account_banking_mandate/models/account_invoice.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/account_banking_mandate/models/account_invoice.py b/account_banking_mandate/models/account_invoice.py index 6d67848dc..924cdd470 100644 --- a/account_banking_mandate/models/account_invoice.py +++ b/account_banking_mandate/models/account_invoice.py @@ -41,6 +41,9 @@ class AccountInvoice(models.Model): for onchange_method, changed_fields in list(onchanges.items()): if any(f not in vals for f in changed_fields): invoice = self.new(vals) + invoice = invoice.with_context( + force_company=invoice.company_id.id + ) getattr(invoice, onchange_method)() for field in changed_fields: if field not in vals and invoice[field]: