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

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Mar 22 11:34:02 CET 2007


Author: aurel
Date: Thu Mar 22 11:33:59 2007
New Revision: 13547

URL: http://svn.erp5.org?rev=13547&view=rev
Log:
use getOb to also check catalog at uninstall

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=13547&r1=13546&r2=13547&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/BusinessTemplate.py (original)
+++ erp5/trunk/products/ERP5/Document/BusinessTemplate.py Thu Mar 22 11:33:59 2007
@@ -804,9 +804,7 @@
       object_id = relative_url.split('/')[-1]
       try:
         container = portal.unrestrictedTraverse(container_path)
-        if container.aq_parent.meta_type != 'ERP5 Catalog':
-          # __getitem__ on a catalog wait for an uid
-          object = container[object_id] # We force access to the object to be sure
+        object = container._getOb(object_id) # We force access to the object to be sure
                                         # that appropriate exception is thrown
                                         # in case object is already backup and/or removed
         if trash and trashbin is not None:
@@ -815,7 +813,7 @@
         if container.aq_parent.meta_type == 'ERP5 Catalog' and len(container.objectIds()) == 0:
           # We are removing a ZSQLMethod, remove the SQLCatalog if empty
           container.getParentValue().manage_delObjects([container.id])
-      except (NotFound, KeyError, BadRequest):
+      except (NotFound, KeyError, BadRequest, AttributeError):
         # object is already backup and/or removed
         pass
     BaseTemplateItem.uninstall(self, context, **kw)




More information about the Erp5-report mailing list