Skip to content

Commit

Permalink
Merge PR #724 into 17.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Oct 3, 2024
2 parents 2cdfaa9 + 5fb69b2 commit 830e158
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
13 changes: 12 additions & 1 deletion account_statement_base/models/account_bank_statement.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,18 @@ def action_open_statement_lines(self):
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)]})
action.update(
{
"domain": [("statement_id", "=", self.id)],
"context": {
"default_journal_id": self._context.get("active_id")
if self._context.get("active_model") == "account.journal"
else None,
"account_bank_statement_line_main_view": True,
},
}
)

return action

def open_entries(self):
Expand Down
19 changes: 19 additions & 0 deletions account_statement_base/views/account_bank_statement.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,23 @@
<field name="view_mode">tree,form,pivot,graph</field>
</record>

<record id="view_bank_statement_tree" model="ir.ui.view">
<field name="name">account.bank.statement.tree</field>
<field name="model">account.bank.statement</field>
<field name="inherit_id" ref="account.view_bank_statement_tree" />
<field name="arch" type="xml">
<tree position="attributes">
<attribute name="create">true</attribute>
</tree>
<field name="balance_end_real" position="after">
<button
name="action_open_statement_lines"
type="object"
title="Open Statement Lines"
icon="fa-folder-open-o"
/>
</field>
</field>
</record>

</odoo>

0 comments on commit 830e158

Please sign in to comment.