[FIX] account_payment_order: out of index date

If we had a payment order with no lines we'll be getting an index error.
Better to avoid it having an empty recordset.
This commit is contained in:
David
2024-07-16 13:26:23 +02:00
parent 572523f026
commit a081876119

View File

@@ -61,5 +61,5 @@ class AccountPayment(models.Model):
if not self.payment_order_id:
return vals_list
for vals in vals_list:
vals["date_maturity"] = self.payment_line_ids[0].date
vals["date_maturity"] = self.payment_line_ids[:1].date
return vals_list