details: https://code.tryton.org/tryton/commit/df7119de4a97
branch: default
user: Cédric Krier <[email protected]>
date: Sat Aug 01 00:56:10 2026 +0200
description:
Use DueDate as fallback for payment term date for UBL without payment
terms
Closes #14981
diffstat:
modules/edocument_ubl/edocument.py | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diffs (23 lines):
diff -r 763adbca3986 -r df7119de4a97 modules/edocument_ubl/edocument.py
--- a/modules/edocument_ubl/edocument.py Tue Jul 28 19:27:57 2026 +0200
+++ b/modules/edocument_ubl/edocument.py Sat Aug 01 00:56:10 2026 +0200
@@ -382,6 +382,9 @@
root.findall('./{*}PaymentMeans'), payees=payees)
invoice.payment_term_date = cls._parse_2_payment_term_date(
root.findall('./{*}PaymentTerms'))
+ if not invoice.payment_term_date:
+ if due_date := root.findtext('./{*}DueDate'):
+ invoice.payment_term_date = dt.date.fromisoformat(due_date)
lines = [
cls._parse_invoice_2_line(
line,
@@ -697,6 +700,9 @@
root.findall('./{*}PaymentMeans'), payees=payees)
invoice.payment_term_date = cls._parse_2_payment_term_date(
root.findall('./{*}PaymentTerms'))
+ if not invoice.payment_term_date:
+ if due_date := root.findtext('./{*}DueDate'):
+ invoice.payment_term_date = dt.date.fromisoformat(due_date)
lines = [
cls._parse_credit_note_2_line(
line, company=invoice.company, currency=invoice.currency,