From 7c0d1ac47b4eeee11019a1324c6229995fc4c3cd Mon Sep 17 00:00:00 2001 From: Vincent Pelletier <vincent@nexedi.com> Date: Tue, 15 Apr 2008 15:15:09 +0000 Subject: [PATCH] If brain is the same as obj, it's better to grab values using accessors, instead of reading brain attributes (this solves discrepancies between what a listbox displays and what the accessor computes on a document). In the process, replace a hasattr by a getattr. git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@20540 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5Form/ListBox.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/product/ERP5Form/ListBox.py b/product/ERP5Form/ListBox.py index 2cf411e6b2..d40ee0f9db 100644 --- a/product/ERP5Form/ListBox.py +++ b/product/ERP5Form/ListBox.py @@ -1940,7 +1940,7 @@ class ListBoxRendererLine: # If a tales expression is not defined, get a skin, an accessor or a property. if not tales: - if hasattr(aq_self(brain), alias): + if brain is not obj and getattr(aq_self(brain), alias, None) is not None: original_value = getattr(brain, alias) processed_value = original_value elif obj is not None: -- 2.30.9