details: https://code.tryton.org/tryton/commit/3bb659ccd03c
branch: default
user: Cédric Krier <[email protected]>
date: Mon Jan 05 12:15:49 2026 +0100
description:
Add support for payment reference for incoming invoice
Closes #14465
diffstat:
modules/document_incoming_ocr/CHANGELOG | 1 +
modules/document_incoming_ocr/document.py | 3 +++
modules/document_incoming_ocr_typless/CHANGELOG | 1 +
modules/document_incoming_ocr_typless/doc/setup.rst | 2 ++
modules/document_incoming_ocr_typless/document.py | 6 ++++--
5 files changed, 11 insertions(+), 2 deletions(-)
diffs (64 lines):
diff -r 5b605ac1dc43 -r 3bb659ccd03c modules/document_incoming_ocr/CHANGELOG
--- a/modules/document_incoming_ocr/CHANGELOG Wed Dec 31 15:57:40 2025 +0100
+++ b/modules/document_incoming_ocr/CHANGELOG Mon Jan 05 12:15:49 2026 +0100
@@ -1,3 +1,4 @@
+* Add support for payment reference of invoice
Version 7.8.0 - 2025-12-15
--------------------------
diff -r 5b605ac1dc43 -r 3bb659ccd03c modules/document_incoming_ocr/document.py
--- a/modules/document_incoming_ocr/document.py Wed Dec 31 15:57:40 2025 +0100
+++ b/modules/document_incoming_ocr/document.py Mon Jan 05 12:15:49 2026 +0100
@@ -124,6 +124,9 @@
"Cannot parse payment term date "
f"'{payment_term_date}'")
+ if payment_reference := invoice_data.get('payment_reference'):
+ invoice.supplier_payment_reference = payment_reference
+
lines = []
for parsed_line in invoice_data.get('lines', []):
line = self._process_supplier_invoice_line(
diff -r 5b605ac1dc43 -r 3bb659ccd03c
modules/document_incoming_ocr_typless/CHANGELOG
--- a/modules/document_incoming_ocr_typless/CHANGELOG Wed Dec 31 15:57:40
2025 +0100
+++ b/modules/document_incoming_ocr_typless/CHANGELOG Mon Jan 05 12:15:49
2026 +0100
@@ -1,3 +1,4 @@
+* Add support for payment reference of invoice
Version 7.8.0 - 2025-12-15
--------------------------
diff -r 5b605ac1dc43 -r 3bb659ccd03c
modules/document_incoming_ocr_typless/doc/setup.rst
--- a/modules/document_incoming_ocr_typless/doc/setup.rst Wed Dec 31
15:57:40 2025 +0100
+++ b/modules/document_incoming_ocr_typless/doc/setup.rst Mon Jan 05
12:15:49 2026 +0100
@@ -56,6 +56,8 @@
- ``payment_term_date``: ``Date`` (optional)
+ - ``payment_reference``: ``String`` (optional)
+
- ``total_amount``: ``Number``
- ``untaxed_amount``: ``Number`` (optional)
diff -r 5b605ac1dc43 -r 3bb659ccd03c
modules/document_incoming_ocr_typless/document.py
--- a/modules/document_incoming_ocr_typless/document.py Wed Dec 31 15:57:40
2025 +0100
+++ b/modules/document_incoming_ocr_typless/document.py Mon Jan 05 12:15:49
2026 +0100
@@ -115,8 +115,8 @@
for name in [
'company_name', 'company_tax_identifier', 'supplier_name',
'tax_identifier', 'currency', 'number', 'description',
- 'invoice_date', 'payment_term_date', 'total_amount',
- 'purchase_orders']:
+ 'invoice_date', 'payment_term_date', 'payment_reference',
+ 'total_amount', 'purchase_orders']:
value = get_best_value(fields, name)
if value is not None:
if name == 'total_amount':
@@ -270,6 +270,8 @@
return invoice.payment_term_date.isoformat()
else:
return ''
+ elif name == 'payment_reference':
+ return invoice.supplier_payment_reference
elif name == 'untaxed_amount':
return str(invoice.untaxed_amount)
elif name == 'tax_amount':