diff --git a/account_reconcile_oca/models/account_bank_statement.py b/account_reconcile_oca/models/account_bank_statement.py
index 19b9bec166..8ad1c39428 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):
@@ -13,3 +14,17 @@ def action_open_statement(self):
)
action["res_id"] = self.id
return action
+
+ def action_open_statement_lines(self):
+ """Open in reconciling view directly"""
+ self.ensure_one()
+ if not self:
+ return {}
+ 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._context.get("active_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