[Erp5-report] r26064 - /erp5/trunk/products/ERP5Form/Report.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Mar 17 10:57:52 CET 2009


Author: jerome
Date: Tue Mar 17 10:57:50 2009
New Revision: 26064

URL: http://svn.erp5.org?rev=26064&view=rev
Log:
revert 26047 and explain the reason of clearing request.form here

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

Modified: erp5/trunk/products/ERP5Form/Report.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Form/Report.py?rev=26064&r1=26063&r2=26064&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Form/Report.py [utf8] (original)
+++ erp5/trunk/products/ERP5Form/Report.py [utf8] Tue Mar 17 10:57:50 2009
@@ -342,6 +342,18 @@
 
     self.saved_request_form = REQUEST.form
 
+    # REQUEST.form is cleared here, because when rendering a report section
+    # with a listbox, listbox gets parameters from request.form and edits
+    # selection with those parameters, so if you happen to pass explicitly
+    # selection params that have the same name as some request parameters (some
+    # dialog fields) but different values, listbox would not use your explicit
+    # parameters, but the ones from REQUEST.form.
+    # As a result, request parameters are not available inside a report
+    # section, and if one needs to access report parameters from inside a
+    # report section, he have to store them in selection parameters in the
+    # report method (the method returning the list of ReportSection)
+    REQUEST.form = {}
+
   security.declarePublic('popReport')
   def popReport(self, context, render_prefix=None):
     REQUEST = get_request()




More information about the Erp5-report mailing list