From 917213ee76c97c596576b9b884cc817c1d219d1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Palomar=20Rodr=C3=ADguez?= Date: Mon, 20 Mar 2023 19:53:57 +0100 Subject: [PATCH] Fix Element evaluation Warning when try to cast an Element Tree in a Boolean. Use `is not None` --- .../wizard/account_invoice_import.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_invoice_import_facturae/wizard/account_invoice_import.py b/account_invoice_import_facturae/wizard/account_invoice_import.py index deaca55bca6..3bf73e54246 100644 --- a/account_invoice_import_facturae/wizard/account_invoice_import.py +++ b/account_invoice_import_facturae/wizard/account_invoice_import.py @@ -100,7 +100,7 @@ def parse_facturae_invoice(self, xml_root, xsd_file): if 'customer' in self.env.context: account_to_be_credited = invoice.find('PaymentDetails/Installment/AccountToBeCredited/AccountNumber') account_to_be_debited = invoice.find('PaymentDetails/Installment/AccountToBeDebited/AccountNumber') - acc_number = (account_to_be_debited and account_to_be_debited.text or account_to_be_credited and account_to_be_credited.text) + acc_number = (account_to_be_debited is not None and account_to_be_debited.text or account_to_be_credited is not None and account_to_be_credited.text) else: acc_number = False res = {