mirror of
https://github.com/OCA/account-reconcile.git
synced 2025-01-20 12:27:39 +02:00
[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:
committed by
Duy (Đỗ Anh)
parent
8d1bfb0a39
commit
0b0b3f9c88
32
account_statement_base/models/account_bank_statement.py
Normal file
32
account_statement_base/models/account_bank_statement.py
Normal file
@@ -0,0 +1,32 @@
|
||||
from odoo import _, models
|
||||
|
||||
|
||||
class AccountBankStatement(models.Model):
|
||||
_inherit = "account.bank.statement"
|
||||
|
||||
def action_open_statement_lines(self):
|
||||
self.ensure_one()
|
||||
if not self:
|
||||
return {}
|
||||
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)]})
|
||||
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),
|
||||
],
|
||||
}
|
||||
Reference in New Issue
Block a user