[Erp5-report] r29900 - /erp5/trunk/products/ERP5/Document/BusinessTemplate.py

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Oct 21 18:39:30 CEST 2009


Author: leonardo
Date: Wed Oct 21 18:39:29 2009
New Revision: 29900

URL: http://svn.erp5.org?rev=29900&view=rev
Log:
Make tests work without loading zcml for the moment.

Modified:
    erp5/trunk/products/ERP5/Document/BusinessTemplate.py

Modified: erp5/trunk/products/ERP5/Document/BusinessTemplate.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/BusinessTemplate.py?rev=29900&r1=29899&r2=29900&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/BusinessTemplate.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/BusinessTemplate.py [utf8] Wed Oct 21 18:39:29 2009
@@ -2446,16 +2446,22 @@
 
           # 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
+          try:
+            from Products.CMFCore.interfaces import IActionProvider
+          except ImportError:
+              # we still don't load ZCML on tests on 2.8, but on 2.8 we don't
+              # need to redirect actions to portal_actions.
+              pass
+          else:
+            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)):




More information about the Erp5-report mailing list