Commit 45b508a0 authored by iv's avatar iv

ERP5Workflow: same but cleaner way without storage_id

parent 59ec192a
......@@ -774,7 +774,7 @@ class ERP5Site(FolderMixIn, CMFSite, CacheCookieMixin):
state_list = []
for wf in self.portal_workflow.objectValues():
for state in wf.getStateValueList():
if group in getattr(state, 'type_list', ()):
if group in state.getStateTypeList():
state_list.append(state.getReference())
return tuple(state_list)
......@@ -1300,7 +1300,7 @@ class ERP5Site(FolderMixIn, CMFSite, CacheCookieMixin):
for wf in self.portal_workflow.objectValues():
if wf.getVariableValueDict() and wf.getStateVariable() == 'simulation_state':
for state in wf.getStateValueList():
if getattr(state, 'type_list', None):
if state.getStateTypeList():
state_list.append(state.getReference())
return tuple(sorted_list)
......
......@@ -38,7 +38,9 @@
</item>
<item>
<key> <string>storage_id</string> </key>
<value> <string>type_list</string> </value>
<value>
<none/>
</value>
</item>
</dictionary>
</pickle>
......
......@@ -843,6 +843,8 @@ def DCWorkflowDefinition_getScriptValueList(self):
return []
def StateDefinition_getDestinationIdList(self):
return self.transitions
def StateDefinition_getStateTypeList(self):
return getattr(self, 'type_list', ())
def DCWorkflowDefinition_getPortalType(self):
return self.__class__.__name__
def method_getReference(self):
......@@ -1113,6 +1115,7 @@ StateDefinition.getReference = method_getReference
StateDefinition.getDestinationIdList = StateDefinition_getDestinationIdList
StateDefinition.getDestinationReferenceList = StateDefinition_getDestinationIdList
StateDefinition.showDict = DCWorkflowDefinition_showDict
StateDefinition.getStateTypeList = StateDefinition_getStateTypeList
TransitionDefinition.getParentValue = TransitionDefinition_getParentValue
TransitionDefinition.getReference = method_getReference
TransitionDefinition.showDict = DCWorkflowDefinition_showDict
......
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