mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
Set company_id earlier in the invoice preparation process so that _onchange_partner can execute as intended.
This commit is contained in:
@@ -309,6 +309,7 @@ class ContractContract(models.Model):
|
|||||||
vinvoice = self.env['account.invoice'].with_context(
|
vinvoice = self.env['account.invoice'].with_context(
|
||||||
force_company=self.company_id.id,
|
force_company=self.company_id.id,
|
||||||
).new({
|
).new({
|
||||||
|
'company_id': self.company_id.id,
|
||||||
'partner_id': self.invoice_partner_id.id,
|
'partner_id': self.invoice_partner_id.id,
|
||||||
'type': invoice_type,
|
'type': invoice_type,
|
||||||
})
|
})
|
||||||
@@ -320,7 +321,6 @@ class ContractContract(models.Model):
|
|||||||
'date_invoice': date_invoice,
|
'date_invoice': date_invoice,
|
||||||
'journal_id': journal.id,
|
'journal_id': journal.id,
|
||||||
'origin': self.name,
|
'origin': self.name,
|
||||||
'company_id': self.company_id.id,
|
|
||||||
'user_id': self.user_id.id,
|
'user_id': self.user_id.id,
|
||||||
})
|
})
|
||||||
if self.payment_term_id:
|
if self.payment_term_id:
|
||||||
|
|||||||
Reference in New Issue
Block a user