Commit 5fb5457a authored by Sebastien Robin's avatar Sebastien Robin

use the method updateProperty of the PropertyManager when it is necessary,...

use the method updateProperty of the PropertyManager when it is necessary, this should fix new bugs founds by Jerome

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@9704 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 10a6228f
...@@ -873,10 +873,13 @@ class Base( CopyContainer, PortalContent, ActiveObject, ERP5PropertyManager ): ...@@ -873,10 +873,13 @@ class Base( CopyContainer, PortalContent, ActiveObject, ERP5PropertyManager ):
return return
# Finaly use standard PropertyManager # Finaly use standard PropertyManager
#LOG("Changing attr: ",0, key) #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) ERP5PropertyManager._setProperty(self, key, value, type=type)
except ConflictError:
raise
# This should not be there, because this ignore all checks made by # This should not be there, because this ignore all checks made by
# the PropertyManager. If there is problems, please complain to # the PropertyManager. If there is problems, please complain to
# seb@nexedi.com # seb@nexedi.com
...@@ -885,7 +888,6 @@ class Base( CopyContainer, PortalContent, ActiveObject, ERP5PropertyManager ): ...@@ -885,7 +888,6 @@ class Base( CopyContainer, PortalContent, ActiveObject, ERP5PropertyManager ):
# setattr(self, key, value) # setattr(self, key, value)
def _setPropValue(self, key, value, **kw): def _setPropValue(self, key, value, **kw):
#LOG('_setPropValue', 0, 'self = %r, key = %r, value = %r, kw = %r' % (self, key, value, kw))
self._wrapperCheck(value) self._wrapperCheck(value)
if isinstance(value, list): if isinstance(value, list):
value = tuple(value) value = tuple(value)
...@@ -916,13 +918,16 @@ class Base( CopyContainer, PortalContent, ActiveObject, ERP5PropertyManager ): ...@@ -916,13 +918,16 @@ class Base( CopyContainer, PortalContent, ActiveObject, ERP5PropertyManager ):
return return
# Finaly use standard PropertyManager # Finaly use standard PropertyManager
#LOG("Changing attr: ",0, key) #LOG("Changing attr: ",0, key)
try: #try:
ERP5PropertyManager._setPropValue(self, key, value) ERP5PropertyManager._setPropValue(self, key, value)
except ConflictError: #except ConflictError:
raise # raise
except: # This should not be there, because this ignore all checks made by
# This should be removed if we want strict property checking # the PropertyManager. If there is problems, please complain to
setattr(self, key, value) # seb@nexedi.com
#except:
# # This should be removed if we want strict property checking
# setattr(self, key, value)
security.declareProtected( Permissions.View, 'hasProperty' ) security.declareProtected( Permissions.View, 'hasProperty' )
def hasProperty(self, key): def hasProperty(self, key):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment