diff --git a/account_reconcile_oca/models/account_bank_statement.py b/account_reconcile_oca/models/account_bank_statement.py index abfe814878..c6857a4b51 100644 --- a/account_reconcile_oca/models/account_bank_statement.py +++ b/account_reconcile_oca/models/account_bank_statement.py @@ -1,6 +1,7 @@ # Copyright 2024 Dixmit # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). from odoo import models +from odoo.tools.safe_eval import safe_eval class AccountBankStatement(models.Model): @@ -15,9 +16,12 @@ def action_open_statement(self): return action def action_open_statement_lines(self): - """Reconcile statement lines directly""" + """Open in reconciling view directly""" action = self.env["ir.actions.act_window"]._for_xml_id( "account_reconcile_oca.action_bank_statement_line_reconcile" ) action["domain"] = [("statement_id", "=", self.id)] + action["context"] = safe_eval( + action["context"], locals_dict={"active_id": self.journal_id.id} + ) return action diff --git a/account_reconcile_oca/views/account_bank_statement.xml b/account_reconcile_oca/views/account_bank_statement.xml index c3e1e0d064..615ed9bd48 100644 --- a/account_reconcile_oca/views/account_bank_statement.xml +++ b/account_reconcile_oca/views/account_bank_statement.xml @@ -31,7 +31,22 @@ - + + account.bank.statement + + + + object + action_open_statement_lines + + + Edit Bank Statement account.bank.statement