Skip to content

Commit

Permalink
[IMP] account_statement_base: add possibility to navigate from statem…
Browse files Browse the repository at this point in the history
…ent lines to the

associated journal entry through a button. Adds also the journal entry number
as an optional field
  • Loading branch information
JordiBForgeFlow authored and victoralmau committed Sep 25, 2024
1 parent 2b6131a commit aee6b9e
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 0 deletions.
4 changes: 4 additions & 0 deletions account_statement_base/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ Contributors
- Carlos Dauden
- Sergio Teruel

- `ForgeFlow <https://www.forgeflow.com>`__:

- Jordi Ballester

Maintainers
-----------

Expand Down
1 change: 1 addition & 0 deletions account_statement_base/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
from . import account_journal_dashboard
from . import account_bank_statement_line
20 changes: 20 additions & 0 deletions account_statement_base/models/account_bank_statement_line.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# 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
3 changes: 3 additions & 0 deletions account_statement_base/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@
- [Tecnativa](https://www.tecnativa.com):
- Carlos Dauden
- Sergio Teruel
- [ForgeFlow](https://www.forgeflow.com):
- Jordi Ballester

4 changes: 4 additions & 0 deletions account_statement_base/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,10 @@ <h2><a class="toc-backref" href="#toc-entry-4">Contributors</a></h2>
<li>Sergio Teruel</li>
</ul>
</li>
<li><a class="reference external" href="https://www.forgeflow.com">ForgeFlow</a>:<ul>
<li>Jordi Ballester</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="maintainers">
Expand Down
7 changes: 7 additions & 0 deletions account_statement_base/views/account_bank_statement_line.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
<tree editable="top" multi_edit="1" decoration-muted="is_reconciled">
<field name="sequence" />
<field name="date" readonly="is_reconciled" />
<field name="move_id" optional="hide" />
<field name="payment_ref" readonly="is_reconciled" />
<field name="ref" optional="hide" readonly="is_reconciled" />
<field name="transaction_type" optional="hide" />
Expand Down Expand Up @@ -97,6 +98,12 @@
icon="fa-undo"
invisible="not is_reconciled"
/>
<button
name="action_open_journal_entry"
type="object"
title="Open Journal Entry"
icon="fa-folder-open-o"
/>
<field name="company_id" column_invisible="True" />
<field name="is_reconciled" column_invisible="True" />
<field name="currency_id" column_invisible="True" />
Expand Down

0 comments on commit aee6b9e

Please sign in to comment.