mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
@@ -605,19 +605,12 @@ class ContractLine(models.Model):
|
||||
return name
|
||||
|
||||
def _update_recurring_next_date(self):
|
||||
# FIXME: Change method name according to real updated field
|
||||
# e.g.: _update_last_date_invoiced()
|
||||
for rec in self:
|
||||
last_date_invoiced = rec.next_period_date_end
|
||||
recurring_next_date = rec.get_next_invoice_date(
|
||||
last_date_invoiced + relativedelta(days=1),
|
||||
rec.recurring_invoicing_type,
|
||||
rec.recurring_invoicing_offset,
|
||||
rec.recurring_rule_type,
|
||||
rec.recurring_interval,
|
||||
max_date_end=rec.date_end,
|
||||
)
|
||||
rec.write(
|
||||
{
|
||||
"recurring_next_date": recurring_next_date,
|
||||
"last_date_invoiced": last_date_invoiced,
|
||||
}
|
||||
)
|
||||
|
||||
@@ -93,7 +93,7 @@ class ContractRecurrencyMixin(models.AbstractModel):
|
||||
|
||||
@api.depends("next_period_date_start")
|
||||
def _compute_recurring_next_date(self):
|
||||
for rec in self.filtered("next_period_date_start"):
|
||||
for rec in self:
|
||||
rec.recurring_next_date = self.get_next_invoice_date(
|
||||
rec.next_period_date_start,
|
||||
rec.recurring_invoicing_type,
|
||||
|
||||
Reference in New Issue
Block a user