[Erp5-report] r33899 nicolas - /erp5/trunk/products/ERP5Form/Form.py

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Mar 19 09:29:33 CET 2010


Author: nicolas
Date: Fri Mar 19 09:29:27 2010
New Revision: 33899

URL: http://svn.erp5.org?rev=33899&view=rev
Log:
Here we avoid calling field.get_recursive_orig_value
on all fields because it can be acquired from another
field in context. ie, from a listbox field.
AttributeError is not raised and get_recursive_orig_value
does not exists neither on that field.
So, test condition on meta_type attribute to avoid non desirable side effects.

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

Modified: erp5/trunk/products/ERP5Form/Form.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Form/Form.py?rev=33899&r1=33898&r2=33899&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Form/Form.py [utf8] (original)
+++ erp5/trunk/products/ERP5Form/Form.py [utf8] Fri Mar 19 09:29:27 2010
@@ -202,9 +202,14 @@
           'Field.get_value ( %s/%s [%s]), exception on tales_expr: ' %
           ( form.getId(), field.getId(), id), error=sys.exc_info())
       # field may be ProxyField
-      try:
+      # here we avoid calling field.get_recursive_orig_value
+      # on all fields because it can be acquired from another
+      # field in context. ie, from a listbox field.
+      # So, test condition on meta_type attribute to avoid
+      # non desirable side effects.
+      if field.meta_type == 'ProxyField':
         value = field.get_recursive_orig_value(id)
-      except AttributeError:
+      else:
         value = field.get_orig_value(id)
 
     return self.returnValue(field, id, value)




More information about the Erp5-report mailing list