diff --git a/contract/__manifest__.py b/contract/__manifest__.py index 78398874f..ec4357f04 100644 --- a/contract/__manifest__.py +++ b/contract/__manifest__.py @@ -36,6 +36,7 @@ "wizards/contract_manually_create_invoice.xml", "wizards/contract_contract_terminate.xml", "views/contract_tag.xml", + "views/account_move_views.xml", "views/assets.xml", "views/abstract_contract_line.xml", "views/contract.xml", diff --git a/contract/models/contract.py b/contract/models/contract.py index 489d79eef..ef7992ff9 100644 --- a/contract/models/contract.py +++ b/contract/models/contract.py @@ -436,9 +436,13 @@ class ContractContract(models.Model): move_form = Form( self.env["account.move"] .with_company(self.company_id) - .with_context(default_move_type=invoice_type, default_name="/") + .with_context(default_move_type=invoice_type, default_name="/"), + view="contract.view_account_move_contract_helper_form", ) move_form.partner_id = self.invoice_partner_id + move_form.journal_id = journal + move_form.currency_id = self.currency_id + move_form.invoice_date = date_invoice if self.payment_term_id: move_form.invoice_payment_term_id = self.payment_term_id if self.fiscal_position_id: @@ -449,11 +453,7 @@ class ContractContract(models.Model): invoice_vals.update( { "ref": self.code, - "company_id": self.company_id.id, - "currency_id": self.currency_id.id, - "invoice_date": date_invoice, "date": date_invoice, - "journal_id": journal.id, "invoice_origin": self.name, } ) diff --git a/contract/views/account_move_views.xml b/contract/views/account_move_views.xml new file mode 100644 index 000000000..c97bbe415 --- /dev/null +++ b/contract/views/account_move_views.xml @@ -0,0 +1,15 @@ + + + + + + account.move + primary + +
+ + + + +
+