[FIX] contract : ignore date constraint for a note

This commit is contained in:
Florian da Costa
2024-12-03 10:03:49 +01:00
parent 4aff2af5d4
commit 951e2f8363

View File

@@ -453,7 +453,10 @@ class ContractLine(models.Model):
@api.constrains("recurring_next_date", "date_start") @api.constrains("recurring_next_date", "date_start")
def _check_recurring_next_date_start_date(self): def _check_recurring_next_date_start_date(self):
for line in self: for line in self:
if line.display_type == "line_section" or not line.recurring_next_date: if (
line.display_type in ("line_section", "line_note")
or not line.recurring_next_date
):
continue continue
if line.date_start and line.recurring_next_date: if line.date_start and line.recurring_next_date:
if line.date_start > line.recurring_next_date: if line.date_start > line.recurring_next_date: