mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
[FIX] account_banking_pain_base: Proper condition for AdrLine
Steps to reproduce the problem: - Have a partner with no zip code and no city. - Include it in a payment order. - Generate the SEPA XML file. Current behavior: The file couldn't be generated because there's an empty <AdrLine> element. We put properly parenthesis in the conditions for this to no happen. TT40885
This commit is contained in:
@@ -524,8 +524,7 @@ class AccountPaymentOrder(models.Model):
|
|||||||
if (
|
if (
|
||||||
gen_args.get("pain_flavor").startswith("pain.001.001.")
|
gen_args.get("pain_flavor").startswith("pain.001.001.")
|
||||||
or gen_args.get("pain_flavor").startswith("pain.008.001.")
|
or gen_args.get("pain_flavor").startswith("pain.008.001.")
|
||||||
and (partner.zip or partner.city)
|
) and (partner.zip or partner.city):
|
||||||
):
|
|
||||||
adrline2 = etree.SubElement(postal_address, "AdrLine")
|
adrline2 = etree.SubElement(postal_address, "AdrLine")
|
||||||
val = []
|
val = []
|
||||||
if partner.zip:
|
if partner.zip:
|
||||||
|
|||||||
Reference in New Issue
Block a user