From 0b96202e9b13733b67475c93cb8656bd4d8158da Mon Sep 17 00:00:00 2001 From: clementthomas Date: Mon, 30 Sep 2024 17:45:40 +0200 Subject: [PATCH] [FIX]account_statement_base: bug on new bank statement line fixed --- .../models/account_bank_statement.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/account_statement_base/models/account_bank_statement.py b/account_statement_base/models/account_bank_statement.py index df80a0fff6..5dcae41d8d 100644 --- a/account_statement_base/models/account_bank_statement.py +++ b/account_statement_base/models/account_bank_statement.py @@ -11,7 +11,18 @@ def action_open_statement_lines(self): action = self.env["ir.actions.act_window"]._for_xml_id( "account_statement_base.account_bank_statement_line_action" ) - action.update({"domain": [("statement_id", "=", self.id)]}) + action.update( + { + "domain": [("statement_id", "=", self.id)], + "context": { + "default_journal_id": self._context.get("active_id") + if self._context.get("active_model") == "account.journal" + else None, + "account_bank_statement_line_main_view": True, + }, + } + ) + return action def open_entries(self):