mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[14.0][FIX] contract: Compute recurring_next_date for False values too
This commit is contained in:
@@ -95,7 +95,8 @@ class ContractRecurrencyMixin(models.AbstractModel):
|
|||||||
|
|
||||||
@api.depends("next_period_date_start")
|
@api.depends("next_period_date_start")
|
||||||
def _compute_recurring_next_date(self):
|
def _compute_recurring_next_date(self):
|
||||||
for rec in self.filtered("next_period_date_start"):
|
records_with_date_start = self.filtered("next_period_date_start")
|
||||||
|
for rec in records_with_date_start:
|
||||||
rec.recurring_next_date = self.get_next_invoice_date(
|
rec.recurring_next_date = self.get_next_invoice_date(
|
||||||
rec.next_period_date_start,
|
rec.next_period_date_start,
|
||||||
rec.recurring_invoicing_type,
|
rec.recurring_invoicing_type,
|
||||||
@@ -104,6 +105,11 @@ class ContractRecurrencyMixin(models.AbstractModel):
|
|||||||
rec.recurring_interval,
|
rec.recurring_interval,
|
||||||
max_date_end=rec.date_end,
|
max_date_end=rec.date_end,
|
||||||
)
|
)
|
||||||
|
(self - records_with_date_start).update(
|
||||||
|
{
|
||||||
|
"recurring_next_date": False,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
@api.depends("last_date_invoiced", "date_start", "date_end")
|
@api.depends("last_date_invoiced", "date_start", "date_end")
|
||||||
def _compute_next_period_date_start(self):
|
def _compute_next_period_date_start(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user