mirror of
https://github.com/OCA/bank-statement-import.git
synced 2025-01-20 12:37:43 +02:00
[FIX] account_bank_statement_import_paypal: Filter Exception => UnicodeDecodeError + refactoring + exception using multiple files type
This commit is contained in:
committed by
Carlos Roca
parent
9f87886f37
commit
b3bea09143
@@ -66,9 +66,13 @@ class AccountBankStatementImport(models.TransientModel):
|
|||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
def _check_paypal(self, data_file):
|
def _check_paypal(self, data_file):
|
||||||
data_file = self._get_paypal_str_data(data_file)
|
|
||||||
if not self.paypal_map_id:
|
if not self.paypal_map_id:
|
||||||
return False
|
return False
|
||||||
|
try:
|
||||||
|
data_file = self._get_paypal_str_data(data_file)
|
||||||
|
except UnicodeDecodeError as e:
|
||||||
|
_logger.debug(e)
|
||||||
|
return False
|
||||||
headers = self.mapped('paypal_map_id.map_line_ids.name')
|
headers = self.mapped('paypal_map_id.map_line_ids.name')
|
||||||
file_headers = data_file.split('\n', 1)[0]
|
file_headers = data_file.split('\n', 1)[0]
|
||||||
if any(item not in file_headers for item in headers):
|
if any(item not in file_headers for item in headers):
|
||||||
|
|||||||
Reference in New Issue
Block a user