mirror of
https://github.com/OCA/account-reconcile.git
synced 2025-01-20 12:27:39 +02:00
[IMP] account_statement_base: add possibility to navigate from statement lines to the
associated journal entry through a button. Adds also the journal entry number as an optional field
This commit is contained in:
21
account_statement_base/models/account_bank_statement_line.py
Normal file
21
account_statement_base/models/account_bank_statement_line.py
Normal file
@@ -0,0 +1,21 @@
|
||||
# Copyright 2024 ForgeFlow
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import models
|
||||
|
||||
|
||||
class AccountBankStatementLine(models.Model):
|
||||
|
||||
_inherit = "account.bank.statement.line"
|
||||
|
||||
def action_open_journal_entry(self):
|
||||
self.ensure_one()
|
||||
if not self:
|
||||
return {}
|
||||
result = self.env["ir.actions.act_window"]._for_xml_id(
|
||||
"account.action_move_line_form"
|
||||
)
|
||||
res = self.env.ref("account.view_move_form", False)
|
||||
result["views"] = [(res and res.id or False, "form")]
|
||||
result["res_id"] = self.move_id.id
|
||||
return result
|
||||
Reference in New Issue
Block a user