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

[16.0][IMP] account_reconcile_oca: Open reconcile view when press the name on journal name #730

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from
Open
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
8 changes: 8 additions & 0 deletions account_reconcile_oca/models/account_journal.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,11 @@
if self.get_journal_dashboard_datas()["number_to_reconcile"] > 0:
return False
return _("Well done! Everything has been reconciled")

def open_action(self):
self.ensure_one()

Check warning on line 36 in account_reconcile_oca/models/account_journal.py

View check run for this annotation

Codecov / codecov/patch

account_reconcile_oca/models/account_journal.py#L36

Added line #L36 was not covered by tests
if self.type not in ["bank", "cash"]:
return super().open_action()
return self.env["ir.actions.actions"]._for_xml_id(

Check warning on line 39 in account_reconcile_oca/models/account_journal.py

View check run for this annotation

Codecov / codecov/patch

account_reconcile_oca/models/account_journal.py#L38-L39

Added lines #L38 - L39 were not covered by tests
"account_reconcile_oca.action_bank_statement_line_open"
)
20 changes: 20 additions & 0 deletions account_reconcile_oca/views/account_bank_statement_line.xml
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,26 @@
</p>
</field>
</record>
<record id="action_bank_statement_line_open" model="ir.actions.act_window">
<field name="name">Statement lines</field>
<field name="res_model">account.bank.statement.line</field>
<field name="domain">[('journal_id', '=', active_id)]</field>
<field
name="context"
>{'default_journal_id': active_id, 'view_ref': 'account_reconcile_oca.bank_statement_line_form_reconcile_view'}</field>
<field name="view_mode">kanban,tree</field>
<field
name="view_ids"
eval="[(5, 0, 0),
(0, 0, {'view_mode': 'kanban', 'view_id': ref('bank_statement_line_reconcile_view')}),
(0, 0, {'view_mode': 'tree', 'view_id': ref('account_statement_base.account_bank_statement_line_tree')})]"
/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Nothing to reconcile
</p>
</field>
</record>
<record id="action_bank_statement_line_reconcile_all" model="ir.actions.act_window">
<field name="name">Reconcile bank statement lines</field>
<field name="res_model">account.bank.statement.line</field>
Expand Down
Loading