diff --git a/product/ERP5Type/ERP5Type.py b/product/ERP5Type/ERP5Type.py index 5b01e70c544cb911a97d184c0a8751519759c066..b5bf93d5c6beafdccad2e11fec716d35d6f7dfd0 100644 --- a/product/ERP5Type/ERP5Type.py +++ b/product/ERP5Type/ERP5Type.py @@ -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') diff --git a/product/ERP5Type/patches/ActionsTool.py b/product/ERP5Type/patches/ActionsTool.py index b6464d48eeb925bc98505ee480d3773f1702c1de..a593c02b5c964b5a81aa3ea9ccca098ea774925c 100644 --- a/product/ERP5Type/patches/ActionsTool.py +++ b/product/ERP5Type/patches/ActionsTool.py @@ -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) )