Commit 18e56b39 authored by Romain Courteaud's avatar Romain Courteaud

Do not delete the complete chain, but only the uninstalled part.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@18742 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3f6072ac
...@@ -1612,7 +1612,18 @@ class PortalTypeWorkflowChainTemplateItem(BaseTemplateItem): ...@@ -1612,7 +1612,18 @@ class PortalTypeWorkflowChainTemplateItem(BaseTemplateItem):
portal_type = path_splitted[1] portal_type = path_splitted[1]
id = 'chain_%s' % portal_type id = 'chain_%s' % portal_type
if id in chain_dict.keys(): if id in chain_dict.keys():
chain = chain_dict[id]
# It should be better to use regexp
chain = chain.replace(' ', '')
workflow_list = chain.split(',')
workflow_id = self._objects[path]
for i in range(workflow_list.count(workflow_id)):
workflow_list.remove(workflow_id)
chain = ', '.join(workflow_list)
if chain == '':
del chain_dict[id] del chain_dict[id]
else:
chain_dict[id] = chain
context.portal_workflow.manage_changeWorkflows('', props=chain_dict) context.portal_workflow.manage_changeWorkflows('', props=chain_dict)
def preinstall(self, context, installed_bt, **kw): def preinstall(self, context, installed_bt, **kw):
......
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