From 730365f7565a12364bba95baddad14ee07fd97a6 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Tue, 20 Dec 2022 15:53:24 +0100 Subject: [PATCH] [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 element. We put properly parenthesis in the conditions for this to no happen. TT40885 --- account_banking_pain_base/models/account_payment_order.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/account_banking_pain_base/models/account_payment_order.py b/account_banking_pain_base/models/account_payment_order.py index d82a89c3f..854fb409f 100644 --- a/account_banking_pain_base/models/account_payment_order.py +++ b/account_banking_pain_base/models/account_payment_order.py @@ -524,8 +524,7 @@ class AccountPaymentOrder(models.Model): if ( gen_args.get("pain_flavor").startswith("pain.001.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") val = [] if partner.zip: