Skip to content

Commit

Permalink
use acc_number in every import: credited and debited
Browse files Browse the repository at this point in the history
  • Loading branch information
danypr92 committed Mar 23, 2023
1 parent 917213e commit 4cb23ac
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions account_invoice_import_facturae/wizard/account_invoice_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,18 @@ def parse_facturae_invoice(self, xml_root, xsd_file):
invoice.find('Items').findall('InvoiceLine')
]
attachments = {}
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 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
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 is not None
and account_to_be_debited.text
or account_to_be_credited is not None
and account_to_be_credited.text
)
res = {
'type': inv_type,
'partner': partner_dict,
Expand Down

0 comments on commit 4cb23ac

Please sign in to comment.