Merge PR #724 into 17.0

Signed-off-by pedrobaeza
pull/727/head
OCA-git-bot 2024-10-03 14:04:31 +00:00
commit 830e15866f
2 changed files with 31 additions and 1 deletions

View File

@ -11,7 +11,18 @@ class AccountBankStatement(models.Model):
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):

View File

@ -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>