Commit 9566f866 authored by Jérome Perrin's avatar Jérome Perrin

Make sur we do not chain a portal type to the same workflow twice


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5496 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d2e18b9e
...@@ -1177,7 +1177,14 @@ class PortalTypeWorkflowChainTemplateItem(BaseTemplateItem): ...@@ -1177,7 +1177,14 @@ class PortalTypeWorkflowChainTemplateItem(BaseTemplateItem):
old_chain_dict = chain_dict['chain_%s' % portal_type] old_chain_dict = chain_dict['chain_%s' % portal_type]
# XXX we don't use the chain (Default) in erp5 so don't keep it # XXX we don't use the chain (Default) in erp5 so don't keep it
if old_chain_dict != '(Default)' and old_chain_dict != '': if old_chain_dict != '(Default)' and old_chain_dict != '':
chain_dict['chain_%s' % portal_type] = old_chain_dict +', '+self._objects[path] # unique workflow chains
old_chain_workflow_id_set = {}
for wf_id in old_chain_dict.split(', '):
old_chain_workflow_id_set[wf_id] = 1
for wf_id in self._objects[path].split(', '):
old_chain_workflow_id_set[wf_id] = 1
chain_dict['chain_%s' % portal_type] = ', '.join(
old_chain_workflow_id_set.keys())
else: else:
chain_dict['chain_%s' % portal_type] = self._objects[path] chain_dict['chain_%s' % portal_type] = self._objects[path]
else: else:
......
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