[FIX] account: view statement correct action

The dashboard "View Statement" action on bank journals was using the
`open_action` helper, but it was badly computed for journals with
`bank_statements_source` set to `online_sync`. We were directed to the
statement lines instead of the statements; and there was no other way to
go to the list of statements.

closes odoo/odoo#61190

X-original-commit: 78286851034b8f3ef4dcab78e50b7220c0bdd213
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Signed-off-by: wan <william-andre@users.noreply.github.com>
This commit is contained in:
wan
2020-11-02 15:50:34 +00:00
parent 6a2dd450a7
commit be2f050993
2 changed files with 2 additions and 1 deletions
@@ -518,6 +518,7 @@ class account_journal(models.Model):
ctx = dict(self.env.context, default_journal_id=self.id)
if ctx.get('search_default_journal', False):
ctx.update(search_default_journal_id=self.id)
del ctx['search_default_journal'] # otherwise it will do a useless groupby in bank statements
ctx.pop('group_by', None)
ir_model_obj = self.env['ir.model.data']
model, action_id = ir_model_obj.get_object_reference('account', action_name)
@@ -60,7 +60,7 @@
<span role="separator">View</span>
</div>
<div>
<a role="menuitem" type="object" name="open_action">Statements</a>
<a role="menuitem" type="object" name="open_action_with_context" context="{'action_name': 'action_bank_statement_tree', 'search_default_journal': True}">Statements</a>
</div>
<div>
<a role="menuitem" type="object" name="open_action_with_context" context="{'action_name': 'action_bank_statement_line', 'search_default_journal': True}">Operations</a>