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: parse only if mapping if specified
This commit is contained in:
@@ -21,13 +21,14 @@ class AccountBankStatementImport(models.TransientModel):
|
|||||||
|
|
||||||
def _parse_file(self, data_file):
|
def _parse_file(self, data_file):
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
try:
|
if self.paypal_mapping_id:
|
||||||
Parser = self.env["account.bank.statement.import.paypal.parser"]
|
try:
|
||||||
return Parser.parse(
|
Parser = self.env["account.bank.statement.import.paypal.parser"]
|
||||||
self.paypal_mapping_id, data_file, self.attachment_ids[:1].name
|
return Parser.parse(
|
||||||
)
|
self.paypal_mapping_id, data_file, self.attachment_ids[:1].name
|
||||||
except Exception:
|
)
|
||||||
if self.env.context.get("account_bank_statement_import_paypal_test"):
|
except Exception:
|
||||||
raise
|
if self.env.context.get("account_bank_statement_import_paypal_test"):
|
||||||
_logger.warning("PayPal parser error", exc_info=True)
|
raise
|
||||||
|
_logger.warning("PayPal parser error", exc_info=True)
|
||||||
return super()._parse_file(data_file)
|
return super()._parse_file(data_file)
|
||||||
|
|||||||
Reference in New Issue
Block a user