From a081876119dc3d3d11db4021c17652fdd1a8d30f Mon Sep 17 00:00:00 2001 From: David Date: Tue, 16 Jul 2024 13:26:23 +0200 Subject: [PATCH] [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. --- account_payment_order/models/account_payment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_payment_order/models/account_payment.py b/account_payment_order/models/account_payment.py index f3757d7b5..edc62dd4b 100644 --- a/account_payment_order/models/account_payment.py +++ b/account_payment_order/models/account_payment.py @@ -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