[FIX] contract: bug onchange date_start (comparison between bool and date)

This commit is contained in:
Mourad
2022-05-13 15:27:40 +02:00
committed by Pedro M. Baeza
parent e79298dfb8
commit 1a9a2fdaac

View File

@@ -110,7 +110,11 @@ class ContractRecurrencyMixin(models.AbstractModel):
next_period_date_start = rec.last_date_invoiced + relativedelta(days=1)
else:
next_period_date_start = rec.date_start
if rec.date_end and next_period_date_start > rec.date_end:
if (
rec.date_end
and next_period_date_start
and next_period_date_start > rec.date_end
):
next_period_date_start = False
rec.next_period_date_start = next_period_date_start