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

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Apr 18 09:49:59 CEST 2011


Author: luke
Date: Mon Apr 18 09:49:59 2011
New Revision: 45531

URL: http://svn.erp5.org?rev=45531&view=rev
Log:
 - react on keys passed with or without virtual path

As virtual paths are generated on the fly (to avoid BT data migration and
putting inside unreal information) this code has to cope with two types of keys.
One key without added virtual path during first Business Template installation
(as calling code uses install logic) and second, while user has chosen objects
to modify (as calling code uses upgrade logic).

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=45531&r1=45530&r2=45531&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/BusinessTemplate.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/BusinessTemplate.py [utf8] Mon Apr 18 09:49:59 2011
@@ -3428,9 +3428,14 @@ class DocumentTemplateItem(BaseTemplateI
     if context.getTemplateFormatVersion() == 1:
       need_reset = isinstance(self, DocumentTemplateItem)
       for key in self._objects.keys():
-        if update_dict.has_key(key) or force:
+        # to achieve non data migration fresh installation parameters
+        # differ from upgrade parameteres, so here the check have to be
+        # care of both cases
+        upgraded_key = self._getKey(key)
+        if update_dict.has_key(key) or update_dict.has_key(upgraded_key) \
+            or force:
           if not force:
-            action = update_dict[key]
+            action = update_dict.get(key, update_dict.get(upgraded_key))
             if action == 'nothing':
               continue
           text = self._objects[key]



More information about the Erp5-report mailing list