Commit 088ff059 authored by Jérome Perrin's avatar Jérome Perrin

prepand the table name to prevent OperationalError (1052, "Column

'portal_type' in field list is ambiguous") that happens when a related key is
used in the generated query.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@18179 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 746d82fd
...@@ -67,9 +67,10 @@ def getDocumentGroupByWorkflowStateList(self, **kw): ...@@ -67,9 +67,10 @@ def getDocumentGroupByWorkflowStateList(self, **kw):
selection_params = \ selection_params = \
selection_tool.getSelectionParamsFor(selection_name).copy() selection_tool.getSelectionParamsFor(selection_name).copy()
selection_params['where_expression'] = '%s is not NULL' % workflow_state selection_params['where_expression'] = '%s is not NULL' % workflow_state
selection_params['group_by'] = ('portal_type', workflow_state) selection_params['group_by'] = ('catalog.portal_type', workflow_state)
selection_params['select_expression'] = ( selection_params['select_expression'] = (
'count(catalog.uid) as count, portal_type, %s' % workflow_state) 'count(catalog.uid) as count, catalog.portal_type, %s'
% workflow_state)
for brain in self.searchFolder(**selection_params): for brain in self.searchFolder(**selection_params):
doc = brain.getObject() doc = brain.getObject()
......
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