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

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Jan 8 10:40:54 CET 2007


Author: vincent
Date: Mon Jan  8 10:40:52 2007
New Revision: 11915

URL: http://svn.erp5.org?rev=11915&view=rev
Log:
Add a check to determine if the modified SQLCatalog is the default one. if not, no need to trigger a reindex.
Fix a problem when checking for portal_catalog on object which container is at the root of the portal (for example, a document contained directly in a module).

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=11915&r1=11914&r2=11915&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/BusinessTemplate.py (original)
+++ erp5/trunk/products/ERP5/Document/BusinessTemplate.py Mon Jan  8 10:40:52 2007
@@ -608,7 +608,7 @@
               continue
             # If container's container is portal_catalog,
             # then automatically create the container.
-            elif container_path[-2] == 'portal_catalog':
+            elif len(container_path) > 1 and container_path[-2] == 'portal_catalog':
               # The id match, but better double check with the meta type
               # while avoiding the impact of systematic check
               container_container = portal.unrestrictedTraverse(container_path[:-1])
@@ -4061,7 +4061,9 @@
       # update catalog if necessary
       update_catalog=0
       catalog_method = getattr(self, '_catalog_method_item', None)
-      if catalog_method is not None and self.getTemplateFormatVersion() == 1:
+      if catalog_method is not None and self.getTemplateFormatVersion() == 1 \
+        and _getCatalogValue(self) is self.getPortalObject().portal_catalog.getSQLCatalog():
+        # It is needed to update the catalog only if the default SQLCatalog is modified.
         for id in catalog_method._objects.keys():
           if id in object_to_update.keys() or force:
             if not force:




More information about the Erp5-report mailing list