[Erp5-report] r43220 arnaud.fontaine - /erp5/trunk/products/ERP5/Document/BusinessTemplate.py

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Feb 9 10:38:49 CET 2011


Author: arnaud.fontaine
Date: Wed Feb  9 10:38:48 2011
New Revision: 43220

URL: http://svn.erp5.org?rev=43220&view=rev
Log:
Migrate ActionInformation to Portal Type classes, but *only* on bt
installation for now. This commit fixes AttributeError in
testBusinessTemplate.

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=43220&r1=43219&r2=43220&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/BusinessTemplate.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/BusinessTemplate.py [utf8] Wed Feb  9 10:38:48 2011
@@ -2877,8 +2877,15 @@ class ActionTemplateItem(ObjectTemplateI
         container.manage_delObjects([obj.id
           for obj in container.getActionInformationList()
           if obj.getReference() in action_dict])
-        for obj in action_dict.itervalues():
-          container._importOldAction(obj)
+        for name, obj in action_dict.iteritems():
+          imported_action = container._importOldAction(obj).aq_base
+
+          # if that's an old style class, use a portal type class instead
+          # XXX PortalTypeTemplateItem-specific
+          migrateme = getattr(imported_action, '_migrateToPortalTypeClass', None)
+          if migrateme is not None:
+            migrateme()
+
     else:
       BaseTemplateItem.install(self, context, trashbin, **kw)
       p = context.getPortalObject()



More information about the Erp5-report mailing list