BusinessTemplates now store actions into the action_tool when the original...

BusinessTemplates now store actions into the action_tool when the original destination is no longer an IActionProvider (approved by jm)

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@29885 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent aa96de77
......@@ -2446,6 +2446,16 @@ class ActionTemplateItem(ObjectTemplateItem):
# Following code is for actions outside Types Tool.
# It will be removed when they are also converted to ERP5 actions.
from Products.CMFCore.interfaces import IActionProvider
if not IActionProvider.providedBy(container):
# some tools stopped being ActionProviders in CMF 2.x. Drop the
# action into portal_actions.
LOG('Products.ERP5.Document.BusinessTemplate', WARNING,
'Misplaced action',
'Attempted to store action %r in %r which is no longer an '
'IActionProvided. Storing action on portal_actions instead' %
(id, path))
container = p.portal_actions
obj, action = container, obj
action_list = obj.listActions()
for index in range(len(action_list)):
......
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