From 117eb66fc623f93a2e5ff6929cafba338847e10b Mon Sep 17 00:00:00 2001
From: Alexandre Boeglin <alex@nexedi.com>
Date: Thu, 23 Sep 2004 17:57:31 +0000
Subject: [PATCH] Allows report tree statistics for closed branches not to be
 restricted to a strict membership, by passing one more argument into
 selection params.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@1782 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Form/ListBox.py | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/product/ERP5Form/ListBox.py b/product/ERP5Form/ListBox.py
index ae843600c0..4e837e45f4 100755
--- a/product/ERP5Form/ListBox.py
+++ b/product/ERP5Form/ListBox.py
@@ -1297,12 +1297,19 @@ onChange="submitAction(this.form,'%s/portal_selections/setReportRoot')">
                   #LOG('ListBox', 0, 'column = %s, value = %s' % (repr(column), repr(value)))
                   if callable(attribute_value):
                     try:
-                      #params = dict(kw)
-                      #params['operator'] = stats[n]
-                      #attribute_value=attribute_value(**params)
-                      selection.edit(report=current_section[6])
+                      # set report and closed_summary
+                      if report_tree == 1 :
+                        selection.edit(report=current_section[6])
+                        kw['closed_summary'] = 1 - current_section[5]
+                        params = dict(kw)
+                        selection.edit(params=params)
                       attribute_value=attribute_value(selection=selection)
-                      selection.edit(report=None)
+                      # reset report and closed_summary
+                      if report_tree == 1 :
+                        selection.edit(report=None)
+                        del kw['closed_summary']
+                        params = dict(kw)
+                        selection.edit(params=params)
                     except:
                       LOG('ListBox', 0, 'WARNING: Could not call %s with %s: ' % (repr(attribute_value), repr(params)), error=sys.exc_info())
                       pass
-- 
2.30.9