From bd19f3b3593aafaacf4023f4b0bf1914b41ad3c1 Mon Sep 17 00:00:00 2001 From: Jordi Ballester Alomar Date: Fri, 19 Jun 2020 21:04:16 +0200 Subject: [PATCH] fix error parsing field 'original_amount' when it is not being provided in the mapping. --- .../models/account_bank_statement_import_sheet_parser.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/account_bank_statement_import_txt_xlsx/models/account_bank_statement_import_sheet_parser.py b/account_bank_statement_import_txt_xlsx/models/account_bank_statement_import_sheet_parser.py index fb05601..1b0952e 100644 --- a/account_bank_statement_import_txt_xlsx/models/account_bank_statement_import_sheet_parser.py +++ b/account_bank_statement_import_txt_xlsx/models/account_bank_statement_import_sheet_parser.py @@ -220,7 +220,10 @@ class AccountBankStatementImportSheetParser(models.TransientModel): elif original_currency == currency: original_amount = amount - original_amount = self._parse_decimal(original_amount, mapping) + if original_amount is not None: + original_amount = self._parse_decimal(original_amount, mapping) + else: + original_amount = 0.0 line = { 'timestamp': timestamp,