[Erp5-report] r9704 - /erp5/trunk/products/ERP5Type/Base.py

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Sep 6 15:45:14 CEST 2006


Author: seb
Date: Wed Sep  6 15:45:10 2006
New Revision: 9704

URL: http://svn.erp5.org?rev=9704&view=rev
Log:
use the method updateProperty of the PropertyManager when it is necessary, this should fix new bugs founds by Jerome

Modified:
    erp5/trunk/products/ERP5Type/Base.py

Modified: erp5/trunk/products/ERP5Type/Base.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Base.py?rev=9704&r1=9703&r2=9704&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Base.py (original)
+++ erp5/trunk/products/ERP5Type/Base.py Wed Sep  6 15:45:10 2006
@@ -873,10 +873,13 @@
       return
     # Finaly use standard PropertyManager
     #LOG("Changing attr: ",0, key)
-    try:
+    # If we are here, this means we do not use a property that
+    # comes from an ERP5 PropertySheet, we should use the
+    # PropertyManager
+    if ERP5PropertyManager.hasProperty(self,key):
+      ERP5PropertyManager._updateProperty(self, key, value)
+    else:
       ERP5PropertyManager._setProperty(self, key, value, type=type)
-    except ConflictError:
-      raise
     # This should not be there, because this ignore all checks made by
     # the PropertyManager. If there is problems, please complain to 
     # seb at nexedi.com
@@ -885,7 +888,6 @@
     #  setattr(self, key, value)
 
   def _setPropValue(self, key, value, **kw):
-    #LOG('_setPropValue', 0, 'self = %r, key = %r, value = %r, kw = %r' % (self, key, value, kw))
     self._wrapperCheck(value)
     if isinstance(value, list):
       value = tuple(value)
@@ -916,13 +918,16 @@
       return
     # Finaly use standard PropertyManager
     #LOG("Changing attr: ",0, key)
-    try:
-      ERP5PropertyManager._setPropValue(self, key, value)
-    except ConflictError:
-      raise
-    except:
-      # This should be removed if we want strict property checking
-      setattr(self, key, value)
+    #try:
+    ERP5PropertyManager._setPropValue(self, key, value)
+    #except ConflictError:
+    #  raise
+    # This should not be there, because this ignore all checks made by
+    # the PropertyManager. If there is problems, please complain to 
+    # seb at nexedi.com
+    #except:
+    #  # This should be removed if we want strict property checking
+    #  setattr(self, key, value)
 
   security.declareProtected( Permissions.View, 'hasProperty' )
   def hasProperty(self, key):




More information about the Erp5-report mailing list