Commit 05e0ab0b authored by Vincent Pelletier's avatar Vincent Pelletier

erp5_payment_mean: Do not pass selection_domain={}

Such parameter can produce undesired conditions
(ex: FROM catalog as node, ... WHERE node.uid > 0 AND ...) causing poor
performance. So avoid introducing this parameter when its value is empty.
parent ccbf9007
...@@ -4,7 +4,11 @@ cache_key = context.getId() + '_' + script.id ...@@ -4,7 +4,11 @@ cache_key = context.getId() + '_' + script.id
try: try:
return cache[cache_key] return cache[cache_key]
except KeyError: except KeyError:
params = {'selection_domain': context.portal_selections.getSelectionDomainDictFor(selection_name)} if selection_name else {} params = {}
if selection_name:
selection_domain = context.portal_selections.getSelectionDomainDictFor(selection_name)
if selection_domain:
params['selection_domain'] = selection_domain
row, = portal.portal_simulation.getInventoryList( row, = portal.portal_simulation.getInventoryList(
select_dict={'count': 'COUNT(*)'}, select_dict={'count': 'COUNT(*)'},
ignore_group_by=1, ignore_group_by=1,
......
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