Browse Source

[FIX] don't pop account_number

pull/87/head
Holger Brunn 8 years ago
parent
commit
7a6e97a2b2
No known key found for this signature in database GPG Key ID: 1C9760FECA3AE18
  1. 3
      account_bank_statement_import_camt/models/account_bank_statement_import.py

3
account_bank_statement_import_camt/models/account_bank_statement_import.py

@ -22,11 +22,12 @@ class AccountBankStatementImport(models.TransientModel):
parser = Parser()
_logger.debug("Try parsing with camt.")
line_fields = self.env['account.bank.statement.line']._fields
extra_fields = ['account_number']
currency, account_number, statements = parser.parse(data_file)
for statement in statements:
for transaction in statement.get('transactions', []):
for key in transaction.keys():
if key not in line_fields:
if key not in line_fields and key not in extra_fields:
transaction.pop(key)
return currency, account_number, statements
except ValueError:

Loading…
Cancel
Save