From aa8e9a60cfdc0c7cc6c68f8d198e07ca29aab075 Mon Sep 17 00:00:00 2001 From: Julien Muchembled <jm@nexedi.com> Date: Tue, 20 Dec 2011 11:59:02 +0100 Subject: [PATCH] Fix getId/getTitle of broken objects --- product/ERP5Type/dynamic/lazy_class.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/product/ERP5Type/dynamic/lazy_class.py b/product/ERP5Type/dynamic/lazy_class.py index 5b7888d257..f3f169d7da 100644 --- a/product/ERP5Type/dynamic/lazy_class.py +++ b/product/ERP5Type/dynamic/lazy_class.py @@ -28,6 +28,10 @@ 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) + for x in 'id', 'title': + d[x] = property(get(x, getattr(ERP5Base, x, None))) return type(name, base, d) def __getattr__(self, name): -- 2.30.9