Commit 85830ff2 authored by Jérome Perrin's avatar Jérome Perrin

When uninstalling an action, catch the error and continue installing when the action is not found.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5618 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0153f990
......@@ -1725,19 +1725,23 @@ class ActionTemplateItem(ObjectTemplateItem):
if object_path is not None:
keys = [object_path]
else:
keys = self._archive.keys()
keys = self._archive.keys()
for id in keys:
if '|' in id:
relative_url, value = id.split(' | ')
key = 'id'
else:
relative_url, key, value = self._splitPath(id)
obj = p.unrestrictedTraverse(relative_url)
action_list = obj.listActions()
for index in range(len(action_list)):
if getattr(action_list[index], key) == value:
obj.deleteActions(selections=(index,))
break
relative_url, key, value = self._splitPath(id)
obj = p.unrestrictedTraverse(relative_url, None)
if obj is not None:
action_list = obj.listActions()
for index in range(len(action_list)):
if getattr(action_list[index], key) == value:
obj.deleteActions(selections=(index,))
break
else :
LOG('BusinessTemplate', 100,
'unable to uninstall action at %s, ignoring' % relative_url )
BaseTemplateItem.uninstall(self, context, **kw)
class PortalTypeRolesTemplateItem(BaseTemplateItem):
......
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