From 2552e1e979310e35011be0ef5b858e9d6c560122 Mon Sep 17 00:00:00 2001 From: Ronald Portier Date: Tue, 30 Mar 2021 11:05:06 +0200 Subject: [PATCH] [FIX] absi- _paypal Module did not properly check input. If passed any csv file, paypal module would try to use it, even if clearly not a paypal file. --- .../models/account_bank_statement_import_paypal_parser.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/account_bank_statement_import_paypal/models/account_bank_statement_import_paypal_parser.py b/account_bank_statement_import_paypal/models/account_bank_statement_import_paypal_parser.py index 2a6f323d..395ff706 100644 --- a/account_bank_statement_import_paypal/models/account_bank_statement_import_paypal_parser.py +++ b/account_bank_statement_import_paypal/models/account_bank_statement_import_paypal_parser.py @@ -110,6 +110,8 @@ class AccountBankStatementImportPayPalParser(models.TransientModel): header = list(next(csv_data)) data_dict = self._data_dict_constructor(mapping, header) + if data_dict.get("currency_column") is None: + raise ValueError(_("No currency column, not a valid Paypal file")) return self._calculate_lines(csv_data, data_dict, mapping, currency_code)