[Erp5-report] r17484 - /erp5/trunk/products/ZSQLCatalog/ZSQLCatalog.py

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Nov 9 10:15:52 CET 2007


Author: aurel
Date: Fri Nov  9 10:15:51 2007
New Revision: 17484

URL: http://svn.erp5.org?rev=17484&view=rev
Log:
fix condition while using archive to know if object must go in current
catalog or not

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

Modified: erp5/trunk/products/ZSQLCatalog/ZSQLCatalog.py
URL: http://svn.erp5.org/erp5/trunk/products/ZSQLCatalog/ZSQLCatalog.py?rev=17484&r1=17483&r2=17484&view=diff
==============================================================================
--- erp5/trunk/products/ZSQLCatalog/ZSQLCatalog.py (original)
+++ erp5/trunk/products/ZSQLCatalog/ZSQLCatalog.py Fri Nov  9 10:15:51 2007
@@ -741,6 +741,7 @@
         url_list.append(url)
         
       goto_current_catalog = 0
+      # either we are doing archiving, either we have used archive without a catalog specified
       if (not disable_archive) and (archiving or (len(archive_obj_list) > 0 and sql_catalog_id is None)):
         # check in which archive object must go if we defined archive
         catalog_id = None
@@ -748,12 +749,16 @@
           if archive.test(obj) is True:
             goto_current_catalog = 0
             catalog_id = archive.getCatalogId()
+            # if current catalog, no need to construct dict as it will be reindex now
+            if catalog_id in (default_catalog.id, self.source_sql_catalog_id):
+              goto_current_catalog = 1
+              continue
             priority = archive.getPriority()
             if catalog_dict.has_key(catalog_id):
               catalog_dict[catalog_id]['obj'].append(obj)
             else:
               catalog_dict[catalog_id] = {'priority' : priority, 'obj' : [obj,]}
-        if catalog_id is None or sql_catalog_id is None or self.source_sql_catalog_id == catalog.id:
+        if catalog_id is None:
           # at least put object in current catalog if no archive match
           goto_current_catalog = 1
       else:




More information about the Erp5-report mailing list