[Erp5-report] r29628 - in /erp5/trunk/products/ERP5Type: ERP5Type.py patches/ActionsTool.py

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Oct 14 10:55:01 CEST 2009


Author: jm
Date: Wed Oct 14 10:54:59 2009
New Revision: 29628

URL: http://svn.erp5.org?rev=29628&view=rev
Log:
Revert [29618] for the moment because it breaks getDefaultViewFor

[29618] changes API and should need discussion.

Modified:
    erp5/trunk/products/ERP5Type/ERP5Type.py
    erp5/trunk/products/ERP5Type/patches/ActionsTool.py

Modified: erp5/trunk/products/ERP5Type/ERP5Type.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/ERP5Type.py?rev=29628&r1=29627&r2=29628&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/ERP5Type.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/ERP5Type.py [utf8] Wed Oct 14 10:54:59 2009
@@ -519,8 +519,8 @@
     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')

Modified: erp5/trunk/products/ERP5Type/patches/ActionsTool.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/patches/ActionsTool.py?rev=29628&r1=29627&r2=29628&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/patches/ActionsTool.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/patches/ActionsTool.py [utf8] Wed Oct 14 10:54:59 2009
@@ -30,8 +30,12 @@
         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) )




More information about the Erp5-report mailing list