[IMP] account_statement_base: Show action to create Statements

Before this commit, when a user clicked the "New Transaction" button, an error was raised. After this commit, statement lines are displayed to create new records.
This commit is contained in:
Carlos Lopez
2024-08-07 14:43:57 -05:00
committed by Enric Tobella
parent 716c639171
commit b74fe1f217
3 changed files with 18 additions and 0 deletions

View File

@@ -0,0 +1 @@
from . import models

View File

@@ -0,0 +1 @@
from . import account_journal_dashboard

View File

@@ -0,0 +1,16 @@
from odoo import models
class AccountJournal(models.Model):
_inherit = "account.journal"
def create_cash_statement(self):
# Totally override this action for avoiding the standard
# message saying that you need to install the enterprise
# module. We do the equivalent thing instead.
self.ensure_one()
action = self.env["ir.actions.actions"]._for_xml_id(
"account_statement_base.account_bank_statement_line_action"
)
action["context"] = {"search_default_journal_id": self.id}
return action