Commit 2a3d4fce authored by Julien Muchembled's avatar Julien Muchembled

Revert [29618] for the moment because it breaks getDefaultViewFor

[29618] changes API and should need discussion.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@29628 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0adbd107
......@@ -519,8 +519,8 @@ class ERP5TypeInformation(XMLObject,
def getFilteredActionListFor(self, ob=None):
"""Return all actions applicable to the object"""
ec = createExpressionContext(ob)
return (action.getActionInfo(ec) for action \
in self.getActionInformationList() if action.test(ec))
return (action for action in self.getActionInformationList()
if action.test(ec))
security.declareProtected(Permissions.AccessContentsInformation,
'getActionInformationList')
......
......@@ -30,8 +30,12 @@ def listFilteredActionsFor(self, object=None):
if IActionProvider.isImplementedBy(provider):
actions.extend( provider.listActionInfos(object=object) )
elif hasattr(provider, 'getFilteredActionListFor'):
actions += sorted(provider.getFilteredActionListFor(object),
key=lambda x:x['priority'])
from Products.ERP5Type.Utils import createExpressionContext
ec = createExpressionContext(object)
actions += sorted(
(action.getActionInfo(ec)
for action in provider.getFilteredActionListFor(object)),
key=lambda x: x['priority'])
else:
# for Action Providers written for CMF versions before 1.5
actions.extend( self._listActionInfos(provider, object) )
......
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