[Erp5-report] r20540 - /erp5/trunk/products/ERP5Form/ListBox.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Apr 15 17:15:10 CEST 2008


Author: vincent
Date: Tue Apr 15 17:15:09 2008
New Revision: 20540

URL: http://svn.erp5.org?rev=20540&view=rev
Log:
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.

Modified:
    erp5/trunk/products/ERP5Form/ListBox.py

Modified: erp5/trunk/products/ERP5Form/ListBox.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Form/ListBox.py?rev=20540&r1=20539&r2=20540&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Form/ListBox.py (original)
+++ erp5/trunk/products/ERP5Form/ListBox.py Tue Apr 15 17:15:09 2008
@@ -1940,7 +1940,7 @@
 
         # 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:




More information about the Erp5-report mailing list