[Erp5-report] r43299 kazuhiko - /erp5/trunk/products/ERP5Type/ERP5Type.py

nobody at svn.erp5.org nobody at svn.erp5.org
Sat Feb 12 22:15:51 CET 2011


Author: kazuhiko
Date: Sat Feb 12 22:15:51 2011
New Revision: 43299

URL: http://svn.erp5.org?rev=43299&view=rev
Log:
create Role Information object as portal_type_as_class way instead of old-fashioned class.

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

Modified: erp5/trunk/products/ERP5Type/ERP5Type.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/ERP5Type.py?rev=43299&r1=43298&r2=43299&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/ERP5Type.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/ERP5Type.py [utf8] Sat Feb 12 22:15:51 2011
@@ -155,8 +155,7 @@ class LocalRoleAssignorMixIn(object):
 
     def _importRole(self, role_property_dict):
       """Import a role from a BT or from an old portal type"""
-      from Products.ERP5Type.Document.RoleInformation import RoleInformation
-      role = RoleInformation(self.generateNewId())
+      role = self.newContent(portal_type='Role Information')
       for k, v in role_property_dict.iteritems():
         if k == 'condition':
           if isinstance(v, Expression):
@@ -174,7 +173,7 @@ class LocalRoleAssignorMixIn(object):
           k = 'role_base_category_script_id'
         setattr(role, k, v)
       role.uid = None
-      return self[self._setObject(role.id, role, set_owner=0)]
+      return role
 
 
 class ERP5TypeInformation(XMLObject,



More information about the Erp5-report mailing list