Commit 6baf7df4 authored by Julien Muchembled's avatar Julien Muchembled

Really fix getId/getTitle of broken objects

Commit aa8e9a60 broke testBusinessTemplate
parent 5f6c557a
......@@ -28,10 +28,16 @@ class ERP5BaseBroken(Broken, ERP5Base):
d = dict(PersistentBroken.__dict__, **d)
for x in '__dict__', '__metaclass__', '__weakref__':
del d[x]
def get(*args):
return lambda self: self.__dict__['__Broken_state__'].get(*args)
def get(x):
def get(self):
d = self.__dict__
try:
return d.get('__Broken_state__', d)[x]
except KeyError:
return getattr(self.__class__, x)
return property(get)
for x in 'id', 'title':
d[x] = property(get(x, getattr(ERP5Base, x, None)))
d[x] = get(x)
return type(name, base, d)
def __getattr__(self, name):
......
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