[12.0][FIX] account_banking_mandate: Set Force company

This commit is contained in:
Enric Tobella
2020-05-15 10:45:06 +02:00
parent d5f9c89399
commit b4c498684c

View File

@@ -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]: