ERP5Workflow: always sort workflow list associated to portal types
Showing
... | @@ -455,7 +455,14 @@ class ERP5TypeInformation(XMLObject, | ... | @@ -455,7 +455,14 @@ class ERP5TypeInformation(XMLObject, |
'setTypeWorkflowList') | 'setTypeWorkflowList') | ||
def setTypeWorkflowList(self, type_workflow_list): | def setTypeWorkflowList(self, type_workflow_list): | ||
"""Setter for 'type_workflow' property""" | """Setter for 'type_workflow' property""" | ||
self.workflow_list = type_workflow_list | # We use 'sorted' below to keep an order in the workflow list. Without | ||
# this line, the actions can have different order depending on the order | |||
# set during the installation or later. This is bad! | |||
# It might not be the ideal solution, if you need to have the workflow | |||
# defined in a specific order. Then, your new implementation should use | |||
# indexes on workflows as in portal types action's priority. | |||
# Note: 'sorted' also convert a tuple or a set to a list | |||
self.workflow_list = sorted(type_workflow_list) | |||
|
|||
def getTypePropertySheetValueList(self): | def getTypePropertySheetValueList(self): | ||
type_property_sheet_list = self.getTypePropertySheetList() | type_property_sheet_list = self.getTypePropertySheetList() | ||
... | ... |