Commit 89be6e05 authored by Romain Courteaud's avatar Romain Courteaud

Set the default action of BusinessTemplate to backup when installing.

It prevents to erase informations which where installed from another BT5.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@10944 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2d470dd3
...@@ -566,7 +566,6 @@ class ObjectTemplateItem(BaseTemplateItem): ...@@ -566,7 +566,6 @@ class ObjectTemplateItem(BaseTemplateItem):
action = update_dict[path] action = update_dict[path]
if action == 'nothing': if action == 'nothing':
continue continue
else:
action = 'backup' action = 'backup'
# get subobjects in path # get subobjects in path
path_list = path.split('/') path_list = path.split('/')
...@@ -639,7 +638,7 @@ class ObjectTemplateItem(BaseTemplateItem): ...@@ -639,7 +638,7 @@ class ObjectTemplateItem(BaseTemplateItem):
wf_chain = subobjects_dict['workflow_chain'] wf_chain = subobjects_dict['workflow_chain']
chain_dict = getChainByType(context)[1] chain_dict = getChainByType(context)[1]
default_chain = '' default_chain = ''
chain_dict['chain_%s' %(object_id)] = wf_chain chain_dict['chain_%s' % (object_id)] = wf_chain
context.portal_workflow.manage_changeWorkflows(default_chain, props=chain_dict) context.portal_workflow.manage_changeWorkflows(default_chain, props=chain_dict)
# import sub objects if there is # import sub objects if there is
elif len(subobjects_dict) > 0: elif len(subobjects_dict) > 0:
...@@ -1394,6 +1393,7 @@ class PortalTypeWorkflowChainTemplateItem(BaseTemplateItem): ...@@ -1394,6 +1393,7 @@ class PortalTypeWorkflowChainTemplateItem(BaseTemplateItem):
chain_dict['chain_%s' % portal_type] = self._objects[path] chain_dict['chain_%s' % portal_type] = self._objects[path]
context.portal_workflow.manage_changeWorkflows(default_chain, context.portal_workflow.manage_changeWorkflows(default_chain,
props=chain_dict) props=chain_dict)
def uninstall(self, context, **kw): def uninstall(self, context, **kw):
(default_chain, chain_dict) = getChainByType(context) (default_chain, chain_dict) = getChainByType(context)
object_path = kw.get('object_path', None) object_path = kw.get('object_path', 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