[Erp5-report] r42970 nicolas.dumazet - /erp5/trunk/products/ERP5Type/Tool/BaseTool.py

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Feb 3 10:56:42 CET 2011


Author: nicolas.dumazet
Date: Thu Feb  3 10:56:42 2011
New Revision: 42970

URL: http://svn.erp5.org?rev=42970&view=rev
Log:
raising an error on migration of Tools is not wise at all:
if some BTs are too old, the portal type will be missing,
and the portal type wont be found, and the instance wont
be upgraded.

This issue needs to be tested more nicely, but for now,
remove the raise

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

Modified: erp5/trunk/products/ERP5Type/Tool/BaseTool.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Tool/BaseTool.py?rev=42970&r1=42969&r2=42970&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Tool/BaseTool.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/Tool/BaseTool.py [utf8] Thu Feb  3 10:56:42 2011
@@ -85,11 +85,11 @@ class BaseTool (UniqueObject, Folder):
       types_tool = self.getPortalObject().portal_types
       type_definition = getattr(types_tool, portal_type, None)
       if type_definition is None:
-        from Products.ERP5.Document.Document import NotConvertedError
-        raise NotConvertedError( 
+        LOG('BaseTool._migrateToPortalTypeClass', WARNING,
             "No portal type definition was found for Tool '%s'"
             " (class %s, portal_type '%s')"
             % (self.getRelativeUrl(), self.__class__.__name__, portal_type))
+        return
 
       type_class = type_definition.getTypeClass()
       if type_class in ('Folder', None):
@@ -99,10 +99,10 @@ class BaseTool (UniqueObject, Folder):
         if document_class_name in document_class_registry:
           type_definition.type_class = document_class_name
         else:
-          from Products.ERP5.Document.Document import NotConvertedError
-          raise NotConvertedError( 
+          LOG('BaseTool._migrateToPortalTypeClass', WARNING,
               'No document class could be found for portal type %s'
               % portal_type)
+          return
 
       return super(BaseTool, self)._migrateToPortalTypeClass()
 



More information about the Erp5-report mailing list