Commit 027f6053 authored by Thomas Bernard's avatar Thomas Bernard

changes on Base.getProperty() suggested by Yo to fix bug while trying to get

a property from an attribute (setProperty is able to set such property on
attributes, but getProperty is unable to recover them).
This is done to add better support on tempObjects for generatig statistics over
Planning view


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@7710 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a788f1ec
......@@ -780,7 +780,8 @@ class Base( CopyContainer, PortalContent, ActiveObject, ERP5PropertyManager ):
return default_value
security.declareProtected( Permissions.AccessContentsInformation, 'getProperty' )
def getProperty(self, key, d=None, **kw):
_marker=[]
def getProperty(self, key, d=_marker, **kw):
"""
Previous Name: getValue
......@@ -801,7 +802,11 @@ class Base( CopyContainer, PortalContent, ActiveObject, ERP5PropertyManager ):
method = getattr(self, accessor_name)
return method(**kw)
else:
return ERP5PropertyManager.getProperty(self, key, d=d, **kw)
value = ERP5PropertyManager.getProperty(self, key, d=d, **kw)
if value is self._marker:
return getattr(self,key)
else:
return getattr(self,key,d)
security.declareProtected( Permissions.AccessContentsInformation, 'getPropertyList' )
def getPropertyList(self, key, d=None):
......
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