[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:
Jordi Ballester Alomar
2024-08-05 12:30:10 +02:00
parent ce99a73946
commit ce3600dc6c
6 changed files with 41 additions and 0 deletions

View 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