Commit 8976a87a authored by Aurel's avatar Aurel

keep old workflow chain at upgrade


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5422 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f7230627
......@@ -106,6 +106,7 @@ def removeAll(entry):
except OSError:
pass
def getChainByType(context):
"""
This is used in order to construct the full list
......@@ -135,7 +136,6 @@ def getChainByType(context):
default_chain=', '.join(pw._default_chain)
return (default_chain, new_dict)
class BusinessTemplateArchive:
"""
This is the base class for all Business Template archives
......@@ -1173,6 +1173,14 @@ class PortalTypeWorkflowChainTemplateItem(BaseTemplateItem):
if action == 'nothing':
continue
portal_type = path.split('/', 1)[1]
if chain_dict.has_key('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
if old_chain_dict != '(Default)' and old_chain_dict != '':
chain_dict['chain_%s' % portal_type] = old_chain_dict +', '+self._objects[path]
else:
chain_dict['chain_%s' % portal_type] = self._objects[path]
else:
chain_dict['chain_%s' % portal_type] = self._objects[path]
context.portal_workflow.manage_changeWorkflows(default_chain,
props=chain_dict)
......@@ -2057,6 +2065,8 @@ class ModuleTemplateItem(BaseTemplateItem):
def uninstall(self, context, **kw):
trash = kw.get('trash', 0)
if trash:
return
object_path = kw.get('object_path', None)
trashbin = kw.get('trashbin', None)
if object_path is None:
......
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