Commit d381e612 authored by Jérome Perrin's avatar Jérome Perrin

accounting: Display nothing in grouping dialog when no account selected

This cause slow queries and returning rows that user won't be able to
group because we only allow to group transactions from the account
parent 92843dd6
......@@ -33,7 +33,10 @@ request.set('precision', precision)
grouping = dialog_selection_params.get('grouping', 'grouping')
search_kw = dict(portal_type=portal.getPortalAccountingMovementTypeList())
search_kw = dict(
node_uid=-1 # prevent a query for all nodes, it would retrieve too many rows.
node = node or request.get('node') or dialog_selection_params.get('node')
if node:
search_kw['node_uid'] = portal.restrictedTraverse(node).getUid()
......@@ -61,10 +61,11 @@ Grouping from entity transaction view
<!-- When no account is selected, we do not display anything. -->
<td>5 records</td>
<td>0 records</td>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment