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