[IMP] account_statement_base: add smart button on view_bank_statement_form linking to journal items

[16.0][FIX] account_statement_base: Changes post OCA CR
This commit is contained in:
Sergio Bustamante
2024-05-24 13:31:56 +02:00
committed by Sergio Bustamante
parent 1192154f2d
commit b27af85c2a
5 changed files with 119 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
from odoo import models
from odoo import _, models
class AccountBankStatement(models.Model):
@@ -13,3 +13,20 @@ class AccountBankStatement(models.Model):
)
action.update({"domain": [("statement_id", "=", self.id)]})
return action
def open_entries(self):
self.ensure_one()
return {
"name": _("Journal Items"),
"view_mode": "tree,form",
"res_model": "account.move.line",
"view_id": False,
"type": "ir.actions.act_window",
"context": {"search_default_group_by_move": 1, "expand": 1},
"search_view_id": self.env.ref("account.view_account_move_line_filter").id,
"domain": [
"&",
("parent_state", "=", "posted"),
("statement_id", "=", self.id),
],
}