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

don't hardcode all possible states, but get them from catalog configuration


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@26821 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c1d6500a
...@@ -52,10 +52,12 @@ def getDocumentGroupByWorkflowStateList(self, **kw): ...@@ -52,10 +52,12 @@ def getDocumentGroupByWorkflowStateList(self, **kw):
selection_tool = portal.portal_selections selection_tool = portal.portal_selections
selection_name = request['selection_name'] selection_name = request['selection_name']
# TODO this should be guessed somehow, but portal_catalog.schema() contains
# much more than what we need here. # guess all column name from catalog schema
possible_state_list = ['validation_state', 'simulation_state', 'payment_state',] possible_state_list = [column_name for column_name in
self.getPortalObject().portal_catalog.getSQLCatalog().getColumnMap() if
column_name.endswith('state') and '.' not in column_name]
# If there are checked uids, only use checked uids. # If there are checked uids, only use checked uids.
selection_uid_list = selection_tool.getSelectionCheckedUidsFor(selection_name) selection_uid_list = selection_tool.getSelectionCheckedUidsFor(selection_name)
......
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