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
anyway.
parent 92843dd6
...@@ -33,7 +33,10 @@ request.set('precision', precision) ...@@ -33,7 +33,10 @@ request.set('precision', precision)
grouping = dialog_selection_params.get('grouping', 'grouping') grouping = dialog_selection_params.get('grouping', 'grouping')
search_kw = dict(portal_type=portal.getPortalAccountingMovementTypeList()) search_kw = dict(
portal_type=portal.getPortalAccountingMovementTypeList(),
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') node = node or request.get('node') or dialog_selection_params.get('node')
if node: if node:
search_kw['node_uid'] = portal.restrictedTraverse(node).getUid() search_kw['node_uid'] = portal.restrictedTraverse(node).getUid()
......
...@@ -61,10 +61,11 @@ Grouping from entity transaction view ...@@ -61,10 +61,11 @@ Grouping from entity transaction view
<td>field_your_node</td> <td>field_your_node</td>
<td></td> <td></td>
</tr> </tr>
<!-- When no account is selected, we do not display anything. -->
<tr> <tr>
<td>assertText</td> <td>assertText</td>
<td>//span[@class="listbox-current-page-total-number"]</td> <td>//span[@class="listbox-current-page-total-number"]</td>
<td>5 records</td> <td>0 records</td>
</tr> </tr>
<tr> <tr>
<td>select</td> <td>select</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