Skip to content

Commit

Permalink
Fix Element evaluation
Browse files Browse the repository at this point in the history
Warning when try to cast an Element Tree in a Boolean. Use `is not None`
  • Loading branch information
danypr92 authored Mar 20, 2023
1 parent 416de0f commit 917213e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit 917213e

Please sign in to comment.