[Erp5-report] r43530 jm - in /erp5/trunk/products/ERP5Type: Tool/ dynamic/

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Feb 21 16:15:12 CET 2011


Author: jm
Date: Mon Feb 21 16:15:12 2011
New Revision: 43530

URL: http://svn.erp5.org?rev=43530&view=rev
Log:
Fix creation of portal_types & portal_property_sheets

Modified:
    erp5/trunk/products/ERP5Type/Tool/BaseTool.py
    erp5/trunk/products/ERP5Type/Tool/TypesTool.py
    erp5/trunk/products/ERP5Type/dynamic/portal_type_class.py

Modified: erp5/trunk/products/ERP5Type/Tool/BaseTool.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Tool/BaseTool.py?rev=43530&r1=43529&r2=43530&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Tool/BaseTool.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/Tool/BaseTool.py [utf8] Mon Feb 21 16:15:12 2011
@@ -76,8 +76,7 @@ class BaseTool (UniqueObject, Folder):
         if container_path:
           id_set = set(x[:-4] for x in files if x[-4:] == '.xml')
         else:
-          id_set = set(quote(x) for x in content_id_list)
-          id_set.difference_update(quote(x) for x in self.objectIds())
+          id_set = set(quote(x) for x in content_id_list if not self.has_key(x))
         dirs[:] = id_set.intersection(dirs)
         for file in id_set:
           load(os.path.join(root, file + '.xml'),

Modified: erp5/trunk/products/ERP5Type/Tool/TypesTool.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Tool/TypesTool.py?rev=43530&r1=43529&r2=43530&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Tool/TypesTool.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/Tool/TypesTool.py [utf8] Mon Feb 21 16:15:12 2011
@@ -128,6 +128,9 @@ class TypesTool(TypeProvider):
       'Standard Property',
       'Acquired Property',
       'Dummy Class Tool',
+      # the following ones are required by '_migrateToPortalTypeClass'
+      'Types Tool',
+      'Property Sheet Tool',
       # the following ones are required to upgrade an existing site
       'Category Property',
     ))

Modified: erp5/trunk/products/ERP5Type/dynamic/portal_type_class.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/dynamic/portal_type_class.py?rev=43530&r1=43529&r2=43530&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/dynamic/portal_type_class.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/dynamic/portal_type_class.py [utf8] Mon Feb 21 16:15:12 2011
@@ -441,6 +441,10 @@ def synchronizeDynamicModules(context, f
         tool_id = tool_class.id
         tool = getattr(portal, tool_id, None)
         if tool is None:
+          # Create a "non-migrated" (types) tool, so that
+          # ERP5Site.migrateToPortalTypeClass doesn't think there nothing to do.
+          # On the other hand, we must make sure TypesTool._bootstrap installs
+          # the needed portal types in order to migrate this bootstrap tool.
           tool = tool_class()
           try:
             portal._setObject(tool_id, tool, set_owner=False, suppress_events=True)



More information about the Erp5-report mailing list