From 05fe36d3ae975d67504590101340f6924a7e02f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Valaeys?= Date: Mon, 23 Mar 2020 14:06:06 +0100 Subject: [PATCH] Set company_id earlier in the invoice preparation process so that _onchange_partner can execute as intended. --- contract/__manifest__.py | 2 +- contract/models/contract.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contract/__manifest__.py b/contract/__manifest__.py index d02ed8d80..60a41bd35 100644 --- a/contract/__manifest__.py +++ b/contract/__manifest__.py @@ -9,7 +9,7 @@ { 'name': 'Recurring - Contracts Management', - 'version': '12.0.6.0.1', + 'version': '12.0.6.0.2', 'category': 'Contract Management', 'license': 'AGPL-3', 'author': "OpenERP SA, " diff --git a/contract/models/contract.py b/contract/models/contract.py index e6f55cd8b..ea007c2c0 100644 --- a/contract/models/contract.py +++ b/contract/models/contract.py @@ -309,6 +309,7 @@ class ContractContract(models.Model): vinvoice = self.env['account.invoice'].with_context( force_company=self.company_id.id, ).new({ + 'company_id': self.company_id.id, 'partner_id': self.invoice_partner_id.id, 'type': invoice_type, }) @@ -320,7 +321,6 @@ class ContractContract(models.Model): 'date_invoice': date_invoice, 'journal_id': journal.id, 'origin': self.name, - 'company_id': self.company_id.id, 'user_id': self.user_id.id, }) if self.payment_term_id: