Add Payment order template

This commit is contained in:
2026-04-07 14:15:10 +02:00
parent 78e9e06a8b
commit eaa5c8b544
2 changed files with 17 additions and 9 deletions

View File

@@ -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):