From eaa5c8b544b3320ace23690dcfaa66f7ca7f1fbf Mon Sep 17 00:00:00 2001 From: laurentbarontini Date: Tue, 7 Apr 2026 14:15:10 +0200 Subject: [PATCH] Add Payment order template --- modules/account_invoice/payment_order.fodt | 11 +++++++---- modules/purchase_trade/invoice.py | 15 ++++++++++----- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/modules/account_invoice/payment_order.fodt b/modules/account_invoice/payment_order.fodt index 64ab26a..1607f47 100644 --- a/modules/account_invoice/payment_order.fodt +++ b/modules/account_invoice/payment_order.fodt @@ -1667,7 +1667,8 @@ From: - Account Number : <records[0].report_payment_order_from_account_nb or ''> + <records[0].report_payment_order_short_name or ''> + Account Number: <records[0].report_payment_order_from_account_nb or ''> @@ -1695,7 +1696,7 @@ Amount: - <records[0].report_payment_order_amount or ''><records[0].report_payment_order_currency_code or ''> <records[0].report_payment_order_amount or ''> (<records[0].report_payment_order_currency_code or ''> <records[0].report_payment_order_amount or ''>) + <records[0].report_payment_order_currency_code or ''> <records[0].report_payment_order_amount or ''> @@ -1703,7 +1704,7 @@ - (<records[0].report_payment_order_currency_code or ''> <records[0].report_payment_order_amount_text or ''>) + (<records[0].report_payment_order_amount_text or ''>) @@ -1735,7 +1736,9 @@ Beneficiary: - <records[0].report_payment_order_company_address or ''> + <for each="line in (records[0].report_payment_order_company_address or '').split('\n')"> + <line> + </for> diff --git a/modules/purchase_trade/invoice.py b/modules/purchase_trade/invoice.py index 4375f38..17af42c 100644 --- a/modules/purchase_trade/invoice.py +++ b/modules/purchase_trade/invoice.py @@ -227,11 +227,16 @@ class Invoice(metaclass=PoolMeta): @property def report_payment_order_currency_code(self): currency = self.currency - return ( - getattr(currency, 'code', None) - or getattr(currency, 'rec_name', None) - or getattr(currency, 'symbol', None) - or '') + code = getattr(currency, 'code', None) or '' + rec_name = getattr(currency, 'rec_name', None) or '' + symbol = getattr(currency, 'symbol', None) or '' + if code and any(ch.isalpha() for ch in code): + return code + if rec_name and any(ch.isalpha() for ch in rec_name): + return rec_name + if symbol and any(ch.isalpha() for ch in symbol): + return symbol + return code or rec_name or symbol or '' @property def report_payment_order_amount_text(self):