diff --git a/contract/models/abstract_contract_line.py b/contract/models/abstract_contract_line.py index 813eebb1d6a..916cb9a8c86 100644 --- a/contract/models/abstract_contract_line.py +++ b/contract/models/abstract_contract_line.py @@ -36,7 +36,7 @@ class ContractAbstractContractLine(models.AbstractModel): "able to introduce a manual price", ) # Just to have a currency_id here - will get overwriten in contract.line model with the related currency from the contract - currency_id = fields.Many2one('res.currency') + currency_id = fields.Many2one("res.currency") specific_price = fields.Monetary() price_unit = fields.Monetary( string="Unit Price", diff --git a/contract/models/contract.py b/contract/models/contract.py index 14ea9f5baea..ecaeee56be1 100644 --- a/contract/models/contract.py +++ b/contract/models/contract.py @@ -428,7 +428,9 @@ def _prepare_invoice(self, date_invoice, journal=None): "company": self.company_id.name or "", } ) - invoice_type = "in_invoice" if self.contract_type == "purchase" else "out_invoice" + invoice_type = ( + "in_invoice" if self.contract_type == "purchase" else "out_invoice" + ) vals = { "move_type": invoice_type, "company_id": self.company_id.id, @@ -438,21 +440,26 @@ def _prepare_invoice(self, date_invoice, journal=None): "invoice_date": date_invoice, "journal_id": journal.id, "invoice_origin": self.name, - "invoice_line_ids": [ - ], + "invoice_line_ids": [], } if self.payment_term_id: - vals.update({ - 'invoice_payment_term_id': self.payment_term_id.id, - }) + vals.update( + { + "invoice_payment_term_id": self.payment_term_id.id, + } + ) if self.fiscal_position_id: - vals.update({ - 'fiscal_position_id': self.fiscal_position_id.id, - }) + vals.update( + { + "fiscal_position_id": self.fiscal_position_id.id, + } + ) if invoice_type == "out_invoice" and self.user_id: - vals.update({ - 'invoice_user_id': self.user_id.id, - }) + vals.update( + { + "invoice_user_id": self.user_id.id, + } + ) return vals def action_contract_send(self): diff --git a/contract/models/contract_line.py b/contract/models/contract_line.py index 00d3c25dddd..7a2108070f4 100644 --- a/contract/models/contract_line.py +++ b/contract/models/contract_line.py @@ -32,7 +32,7 @@ class ContractLine(models.Model): auto_join=True, ondelete="cascade", ) - currency_id = fields.Many2one(related='contract_id.currency_id') + currency_id = fields.Many2one(related="contract_id.currency_id") analytic_account_id = fields.Many2one( string="Analytic account", comodel_name="account.analytic.account", diff --git a/contract/views/abstract_contract_line.xml b/contract/views/abstract_contract_line.xml index 9a8eaa883c9..e1562f3e4fe 100644 --- a/contract/views/abstract_contract_line.xml +++ b/contract/views/abstract_contract_line.xml @@ -14,32 +14,70 @@ - - - + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + diff --git a/contract/views/contract_template.xml b/contract/views/contract_template.xml index 78d8b1805a5..3af8e564e18 100644 --- a/contract/views/contract_template.xml +++ b/contract/views/contract_template.xml @@ -68,7 +68,8 @@ string="Legend (for the markers inside invoice lines description)" > - #START#: Start date of the invoiced period + #START#: Start date of the invoiced period #END#: End date of the invoiced period
#START#: Start date of the invoiced period
#END#: End date of the invoiced period