From fcb95aa4091f5e84ec70639532d85054a74eafb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 1 Aug 2026 00:57:28 +0200 Subject: [PATCH] Do not compare to None PaymentDueDate value from findtext It is not necessary because findtext returns a string. (grafted from e1801f15caaa2bb23d2d8ba38483617977658bd8) --HG-- branch : 8.0 --- modules/edocument_ubl/edocument.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/edocument_ubl/edocument.py b/modules/edocument_ubl/edocument.py index 80dabb31dc..2c952f9826 100644 --- a/modules/edocument_ubl/edocument.py +++ b/modules/edocument_ubl/edocument.py @@ -1198,8 +1198,7 @@ class Invoice(Model): def _parse_2_payment_term_date(cls, payment_terms): dates = [] for payment_term in payment_terms: - if (date := payment_term.findtext('./{*}PaymentDueDate') - ) is not None: + if date := payment_term.findtext('./{*}PaymentDueDate'): dates.append(dt.date.fromisoformat(date)) return min(dates, default=None)