diff --git a/modules/account_invoice/invoice_melya.fodt b/modules/account_invoice/invoice_melya.fodt index 6321f9e..b806fa5 100644 --- a/modules/account_invoice/invoice_melya.fodt +++ b/modules/account_invoice/invoice_melya.fodt @@ -1585,7 +1585,9 @@ <invoice.report_payment_description or ''>  <if test="invoice.report_melya_bank_name">Bank: <invoice.report_melya_bank_name></if> - <for each="line in invoice.report_melya_bank_address.splitlines()"><line></for> + <for each="line in invoice.report_melya_bank_address.splitlines()"> + <line> + </for> <if test="invoice.report_melya_bank_iban">IBAN : <invoice.report_melya_bank_iban></if> <if test="invoice.report_melya_bank_swift">SwifT Code: <invoice.report_melya_bank_swift></if> diff --git a/modules/purchase_trade/invoice.py b/modules/purchase_trade/invoice.py index fac53a3..c551254 100644 --- a/modules/purchase_trade/invoice.py +++ b/modules/purchase_trade/invoice.py @@ -668,17 +668,17 @@ class Invoice(metaclass=PoolMeta): @staticmethod def _get_report_bank_address_lines(account): address = Invoice._get_report_bank_address(account) - full_address = getattr(address, 'full_address', None) if address else '' - if not full_address and address: - city_line = ' '.join(filter(None, [ - getattr(address, 'postal_code', None), - getattr(address, 'city', None), - ])) - full_address = '\n'.join(filter(None, [ - getattr(address, 'name', None), - getattr(address, 'street', None), - city_line, - ])) + if not address: + return '' + city_line = ' '.join(filter(None, [ + getattr(address, 'postal_code', None), + getattr(address, 'city', None), + ])) + full_address = '\n'.join(filter(None, [ + getattr(address, 'name', None), + getattr(address, 'street', None), + city_line, + ])) return '\n'.join( line for line in (full_address or '').splitlines() if line.strip()) diff --git a/modules/purchase_trade/tests/test_module.py b/modules/purchase_trade/tests/test_module.py index 9c11ebf..d394ec0 100644 --- a/modules/purchase_trade/tests/test_module.py +++ b/modules/purchase_trade/tests/test_module.py @@ -3265,7 +3265,12 @@ class PurchaseTradeTestCase(ModuleTestCase): address = Mock( party_full_name='UBS SWITZERLAND AG', - full_address='Case Postale\nCH-1211 Geneve 2', + name='Case Postale', + street='', + postal_code='CH-1211 Geneve 2', + city='', + full_address='UBS SWITZERLAND AG\nCase Postale\n' + 'CH-1211 Geneve 2', ) party = Mock(rec_name='UBS') party.address_get.return_value = address