Bank Template

This commit is contained in:
2026-05-28 13:46:56 +02:00
parent 26f43c2438
commit 1af7ae99a4
3 changed files with 20 additions and 13 deletions

View File

@@ -1585,7 +1585,9 @@
<text:p text:style-name="P8"><text:span text:style-name="Police_20_par_20_défaut"><text:span text:style-name="T9"><text:placeholder text:placeholder-type="text">&lt;invoice.report_payment_description or &apos;&apos;&gt;</text:placeholder></text:span></text:span><text:span text:style-name="Police_20_par_20_défaut"><text:span text:style-name="T9"> </text:span></text:span></text:p>
<text:p text:style-name="P4"/>
<text:p text:style-name="P21"><text:placeholder text:placeholder-type="text">&lt;if test=&quot;invoice.report_melya_bank_name&quot;&gt;</text:placeholder>Bank: <text:placeholder text:placeholder-type="text">&lt;invoice.report_melya_bank_name&gt;</text:placeholder><text:placeholder text:placeholder-type="text">&lt;/if&gt;</text:placeholder></text:p>
<text:p text:style-name="P8"><text:span text:style-name="Police_20_par_20_défaut"><text:span text:style-name="T9"><text:placeholder text:placeholder-type="text">&lt;for each=&quot;line in invoice.report_melya_bank_address.splitlines()&quot;&gt;</text:placeholder><text:placeholder text:placeholder-type="text">&lt;line&gt;</text:placeholder><text:placeholder text:placeholder-type="text">&lt;/for&gt;</text:placeholder></text:span></text:span></text:p>
<text:p text:style-name="P8"><text:placeholder text:placeholder-type="text">&lt;for each=&quot;line in invoice.report_melya_bank_address.splitlines()&quot;&gt;</text:placeholder></text:p>
<text:p text:style-name="P8"><text:span text:style-name="Police_20_par_20_défaut"><text:span text:style-name="T9"><text:placeholder text:placeholder-type="text">&lt;line&gt;</text:placeholder></text:span></text:span></text:p>
<text:p text:style-name="P8"><text:placeholder text:placeholder-type="text">&lt;/for&gt;</text:placeholder></text:p>
<text:p text:style-name="P4"/>
<text:p text:style-name="P22"><text:placeholder text:placeholder-type="text">&lt;if test=&quot;invoice.report_melya_bank_iban&quot;&gt;</text:placeholder>IBAN : <text:placeholder text:placeholder-type="text">&lt;invoice.report_melya_bank_iban&gt;</text:placeholder><text:placeholder text:placeholder-type="text">&lt;/if&gt;</text:placeholder></text:p>
<text:p text:style-name="P22"><text:placeholder text:placeholder-type="text">&lt;if test=&quot;invoice.report_melya_bank_swift&quot;&gt;</text:placeholder>SwifT Code: <text:placeholder text:placeholder-type="text">&lt;invoice.report_melya_bank_swift&gt;</text:placeholder><text:placeholder text:placeholder-type="text">&lt;/if&gt;</text:placeholder></text:p>

View File

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

View File

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