mirror of
https://github.com/OCA/bank-statement-import.git
synced 2025-01-20 12:37:43 +02:00
account_statement_import: Do not overwrite journal active_id
The call to parse_file must not overwrite the active_id value in the context as this active_id refers to the journal from which the wizard was called. It was especially wrong because the existing active_model key is still set to account.journal, with an active_id that was referencing account.statement.import wizard ID. If the wizard ID is needed, it can still be found on self, and if this ID must be propagated through the context, it must use a dedicated key instead of hijacking the active_id.
This commit is contained in:
@@ -74,7 +74,7 @@ class AccountStatementImport(models.TransientModel):
|
||||
return vals
|
||||
|
||||
def import_single_file(self, file_data, result):
|
||||
parsing_data = self.with_context(active_id=self.ids[0])._parse_file(file_data)
|
||||
parsing_data = self._parse_file(file_data)
|
||||
if not isinstance(parsing_data, list): # for backward compatibility
|
||||
parsing_data = [parsing_data]
|
||||
logger.info(
|
||||
|
||||
Reference in New Issue
Block a user