[Erp5-report] r13445 - in /erp5/trunk/products/ERP5Form: PlanningBox.py SelectionTool.py

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Mar 16 03:46:51 CET 2007


Author: rafael
Date: Fri Mar 16 03:44:14 2007
New Revision: 13445

URL: http://svn.erp5.org?rev=13445&view=rev
Log:
Added one parameter to filter the portal type in the list method.
This commit should only effect the Planning Box.


Modified:
    erp5/trunk/products/ERP5Form/PlanningBox.py
    erp5/trunk/products/ERP5Form/SelectionTool.py

Modified: erp5/trunk/products/ERP5Form/PlanningBox.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Form/PlanningBox.py?rev=13445&r1=13444&r2=13445&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Form/PlanningBox.py (original)
+++ erp5/trunk/products/ERP5Form/PlanningBox.py Fri Mar 16 03:44:14 2007
@@ -1003,7 +1003,6 @@
       params = selection.getParams()
     except (AttributeError,KeyError):
       params = {}
-
     ###### CALL CLASS METHODS TO BUILD BASIC STRUCTURE ######
     # creating BasicStructure instance (and initializing its internal values)
     self.basic = BasicStructure(here=here,form=form, field=field,
@@ -1203,7 +1202,9 @@
                                     unfolded_list=selection_report_current,
                                     selection_name=self.selection_name,
                                     report_depth=report_depth,
-				    list_method=self.list_method,
+                                    list_method=self.list_method,
+				    filtered_portal_types= \
+                                                self.filtered_portal_types,
                                     is_report_opened=is_report_opened,
                                     sort_on=self.selection.sort_on,
                                     form_id=self.form.id)
@@ -1664,6 +1665,7 @@
         # updating position_informations
         position +=1
         # recovering usefull informations, basic_structure
+	# XXX should be used title_lines method 
         title = report_group_object.getObject().getTitle()
         name = report_group_object.getObject().getTitle()
         depth = report_group_object.getDepth()
@@ -2121,7 +2123,6 @@
     else:
       axis_stop = (self.secondary_axis.stop)
       axis_start = (self.secondary_axis.start)
-
 
     axis_script=getattr(basic_structure.here,
                        basic_structure.field.get_value('sec_axis_script'),None)

Modified: erp5/trunk/products/ERP5Form/SelectionTool.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Form/SelectionTool.py?rev=13445&r1=13444&r2=13445&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Form/SelectionTool.py (original)
+++ erp5/trunk/products/ERP5Form/SelectionTool.py Fri Mar 16 03:44:14 2007
@@ -114,7 +114,6 @@
 
       if query_string is not None:
         LOG('SelectionTool', 0, 'DEPRECATED: _redirectToOriginalForm got called with a query_string. The variables must be passed in REQUEST.form.')
-
       context = REQUEST['PARENTS'][0]
       form_id = dialog_id or REQUEST.get('dialog_id', None) or form_id or REQUEST.get('form_id', 'view')
       return getattr(context, form_id)()
@@ -1318,7 +1317,7 @@
 def makeTreeList(here, form, root_dict, report_path, base_category, 
 		  depth, unfolded_list, form_id, selection_name, 
 		  report_depth, is_report_opened=1, list_method=None,
-		  sort_on = (('id', 'ASC'),)):
+		  filtered_portal_types=[] ,sort_on = (('id', 'ASC'),)):
   """
     (object, is_pure_summary, depth, is_open, select_domain_dict)
 
@@ -1374,7 +1373,7 @@
         # If this is a folder, try to browse the hierarchy
         object_list = root.searchFolder(sort_on=sort_on)
     elif hasattr(aq_base(root), list_method.__name__ ):
-      object_list = list_method()
+      object_list = list_method(portal_type=filtered_portal_types)
     else:      
       object_list = []
     for zo in object_list:




More information about the Erp5-report mailing list