Commit 347804af authored by Julien Muchembled's avatar Julien Muchembled

Use default __hash__ method for ERP5 objects

If an object has no uid yet and has no acquisition context to the portal,
getUid() fails.

Default is derived from id(aq_base(ob)) which is even more efficient.

The method on XMLObject was also redundant because it inherited the same one
from Base.
parent 6317f21f
......@@ -2876,10 +2876,6 @@ class Base( CopyContainer,
return dict(redirect_url=container.absolute_url(),
selection_index=None, selection_name=None)
# Hash method
def __hash__(self):
return hash(self.getUid())
security.declareProtected(Permissions.ModifyPortalContent, 'setGuid')
def setGuid(self):
"""
......
......@@ -108,9 +108,5 @@ class XMLObject( Folder ):
conduit = ERP5Conduit()
conduit.addNode(object=self, xml=xml)
# Hash method
def __hash__(self):
return hash(self.getUid())
InitializeClass(XMLObject)
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