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

nobody at svn.erp5.org nobody at svn.erp5.org
Sat Sep 16 13:42:51 CEST 2006


Author: jerome
Date: Sat Sep 16 13:42:48 2006
New Revision: 10026

URL: http://svn.erp5.org?rev=10026&view=rev
Log:
calling getProperty(prop_name, evaluate=0) can fail, because it calls
a method named like "getPropName" which may not accept the evaluate argument.


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=10026&r1=10025&r2=10026&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/BusinessTemplate.py (original)
+++ erp5/trunk/products/ERP5/Document/BusinessTemplate.py Sat Sep 16 13:42:48 2006
@@ -905,9 +905,13 @@
           category = container.newContent(portal_type=obj.getPortalType(), id=category_id)
           if object_uid is not None:
             category.setUid(object_uid)
-          for property in obj.propertyIds():
-            if property not in ('id', 'uid'):
-              category.setProperty(property, obj.getProperty(property, evaluate=0))
+          for prop in obj.propertyIds():
+            if prop not in ('id', 'uid'):
+              try:
+                prop_value = obj.getProperty(prop, evaluate=0)
+              except:
+                prop_value = obj.getProperty(prop)
+              category.setProperty(prop, prop_value)
           # import sub objects if there is
           if len(subobjects_dict) > 0:
             # get a jar
@@ -944,9 +948,13 @@
             subobjects_dict = self._backupObject('backup', trashbin, container_path, category_id)
             container.manage_delObjects([category_id])
           category = container.newContent(portal_type=obj.getPortalType(), id=category_id)
-          for property in obj.propertyIds():
-            if property not in ('id', 'uid'):
-              category.setProperty(property, obj.getProperty(property, evaluate=0))
+          for prop in obj.propertyIds():
+            if prop not in ('id', 'uid'):
+              try:
+                prop_value = obj.getProperty(prop, evaluate=0)
+              except:
+                prop_value = obj.getProperty(prop)
+              category.setProperty(prop, prop_value)
           # import sub objects if there is
           if len(subobjects_dict) > 0:
             # get a jar




More information about the Erp5-report mailing list