[Erp5-report] r15857 - /erp5/trunk/products/ERP5Form/SelectionTool.py

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Aug 27 20:46:10 CEST 2007


Author: rafael
Date: Mon Aug 27 20:46:10 2007
New Revision: 15857

URL: http://svn.erp5.org?rev=15857&view=rev
Log:
Make planning box works as Listbox when filter the portal types.

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

Modified: erp5/trunk/products/ERP5Form/SelectionTool.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Form/SelectionTool.py?rev=15857&r1=15856&r2=15857&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Form/SelectionTool.py (original)
+++ erp5/trunk/products/ERP5Form/SelectionTool.py Mon Aug 27 20:46:10 2007
@@ -1450,8 +1450,13 @@
       if hasattr(aq_base(root), 'objectValues'):
         # If this is a folder, try to browse the hierarchy
         object_list = root.searchFolder(sort_on=sort_on)
-    else:
-      object_list = list_method(portal_type=filtered_portal_types)
+    else: 
+      if filtered_portal_types not in [[],None,'']:
+        object_list = list_method(portal_type=filtered_portal_types)
+      else:
+        object_list = list_method()
+      if len(object_list) == 0:
+        object_list = [root]
     for zo in object_list:
       o = zo.getObject()
       if o is not None:




More information about the Erp5-report mailing list