From 04a76604a9701d562245c4314cd31da4b133d432 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. TT43260 --- account_banking_pain_base/__manifest__.py | 2 +- account_banking_pain_base/models/account_payment_order.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/account_banking_pain_base/__manifest__.py b/account_banking_pain_base/__manifest__.py index a5e7d6a05..99fd4dbb9 100644 --- a/account_banking_pain_base/__manifest__.py +++ b/account_banking_pain_base/__manifest__.py @@ -7,7 +7,7 @@ { "name": "Account Banking PAIN Base Module", "summary": "Base module for PAIN file generation", - "version": "15.0.2.0.1", + "version": "15.0.2.0.2", "license": "AGPL-3", "author": "Akretion, Noviat, Tecnativa, Odoo Community Association (OCA)", "website": "https://github.com/OCA/bank-payment", diff --git a/account_banking_pain_base/models/account_payment_order.py b/account_banking_pain_base/models/account_payment_order.py index fb9cd91d0..3d6dc0331 100644 --- a/account_banking_pain_base/models/account_payment_order.py +++ b/account_banking_pain_base/models/account_payment_order.py @@ -523,8 +523,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") if partner.zip: val = self._prepare_field(