mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[MIG] contract_invoice_start_end_dates: Migration to 14.0
This commit is contained in:
@@ -5,16 +5,18 @@ from odoo import models
|
||||
|
||||
|
||||
class ContractLine(models.Model):
|
||||
_inherit = 'contract.line'
|
||||
_inherit = "contract.line"
|
||||
|
||||
def _prepare_invoice_line(self, invoice_id=False, invoice_values=False):
|
||||
vals = super(ContractLine, self)._prepare_invoice_line(
|
||||
invoice_id=invoice_id, invoice_values=invoice_values)
|
||||
def _prepare_invoice_line(self, move_form):
|
||||
vals = super()._prepare_invoice_line(move_form=move_form)
|
||||
if self.product_id.must_have_dates:
|
||||
dates = self._get_period_to_invoice(
|
||||
self.last_date_invoiced, self.recurring_next_date)
|
||||
vals.update({
|
||||
'start_date': dates[0],
|
||||
'end_date': dates[1],
|
||||
})
|
||||
self.last_date_invoiced, self.recurring_next_date
|
||||
)
|
||||
vals.update(
|
||||
{
|
||||
"start_date": dates[0],
|
||||
"end_date": dates[1],
|
||||
}
|
||||
)
|
||||
return vals
|
||||
|
||||
Reference in New Issue
Block a user