Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[17.0][IMP] account_statement_base: make the statements views editable=top by default #724

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
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(

Check warning on line 14 in account_statement_base/models/account_bank_statement.py

View check run for this annotation

Codecov / codecov/patch

account_statement_base/models/account_bank_statement.py#L14

Added line #L14 was not covered by tests
{
"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>
Loading