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

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Jun 7 16:49:22 CEST 2010


Author: nicolas
Date: Mon Jun  7 16:49:20 2010
New Revision: 36031

URL: http://svn.erp5.org?rev=36031&view=rev
Log:
If update_catalog parameter is passed explicitely, do not
override it. Otherwise business_template.install(update_catalog=False)
can clear the catalog.


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=36031&r1=36030&r2=36031&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/BusinessTemplate.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/BusinessTemplate.py [utf8] Mon Jun  7 16:49:20 2010
@@ -106,6 +106,7 @@
                               '_filter_type_archive',)
 
 INSTALLED_BT_FOR_DIFF = 'installed_bt_for_diff'
+_MARKER = []
 
 def _getCatalog(acquisition_context):
   """
@@ -5208,7 +5209,7 @@
       return modified_object_list
 
     def _install(self, force=1, object_to_update=None, update_translation=0,
-                 update_catalog=0, **kw):
+                 update_catalog=_MARKER, **kw):
       """
         Install a new Business Template, if force, all will be upgraded or installed
         otherwise depends of dict object_to_update
@@ -5276,8 +5277,12 @@
                                trashbin=trashbin, installed_bt=installed_bt)
 
       # update catalog if necessary
-      if force and self.isCatalogUpdatable():
+      if update_catalog is _MARKER and force and self.isCatalogUpdatable():
+        # override update_catalog parameter only if value
+        # is not explicitely passed.
         update_catalog = 1
+      else:
+        update_catalog = 0
       if update_catalog:
         catalog = _getCatalogValue(self)
         if (catalog is None) or (not site.isIndexable):




More information about the Erp5-report mailing list