From 83bd8f71a23257f823e9f854733f208b7c0fa943 Mon Sep 17 00:00:00 2001 From: Akim Juillerat Date: Tue, 28 May 2024 21:14:17 +0200 Subject: [PATCH] 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. --- account_statement_import/wizard/account_statement_import.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_statement_import/wizard/account_statement_import.py b/account_statement_import/wizard/account_statement_import.py index 90fb7c81..99e46f41 100644 --- a/account_statement_import/wizard/account_statement_import.py +++ b/account_statement_import/wizard/account_statement_import.py @@ -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(