Commit fc1e71d3 authored by Sebastien Robin's avatar Sebastien Robin

added group by expression


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3361 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 93415096
...@@ -272,6 +272,16 @@ class SimulationTool (BaseTool): ...@@ -272,6 +272,16 @@ class SimulationTool (BaseTool):
sql_kw.update(self.portal_catalog.buildSQLQuery(**new_kw)) sql_kw.update(self.portal_catalog.buildSQLQuery(**new_kw))
# build the group by expression
group_by_expression_list = []
if kw.get('group_by_node',0):
group_by_expression_list.append('stock.node_uid')
if kw.get('group_by_variation',0):
group_by_expression_list.append('stock.variation_text')
if len(group_by_expression_list):
group_by_expression_list.append('stock.resource_uid') # Always group by resource
sql_kw['group_by_expression'] = ', '.join(group_by_expression_list)
return sql_kw return sql_kw
####################################################### #######################################################
...@@ -335,6 +345,10 @@ class SimulationTool (BaseTool): ...@@ -335,6 +345,10 @@ class SimulationTool (BaseTool):
selection_domain, selection_report - see ListBox selection_domain, selection_report - see ListBox
group_by_variation
group_by_node
**kw - if we want extended selection with more keywords (but bad performance) **kw - if we want extended selection with more keywords (but bad performance)
check what we can do with buildSqlQuery check what we can do with buildSqlQuery
""" """
......
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