Commit ee68b186 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Revert the previous change that selection_columns is set to

the default value if empty. This was annoying when developing
skins.

Delete query from selection params when changing the display mode.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@1204 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 47cf2c46
......@@ -341,11 +341,9 @@ class SelectionTool( UniqueObject, SimpleItem ):
if columns is None: columns = []
selection = self.getSelectionFor(selection_name, REQUEST=REQUEST)
if selection is not None:
if len(selection.selection_columns) == 0:
self.setSelectionColumns(selection_name, columns, REQUEST=REQUEST)
return selection.selection_columns
else:
return columns
if len(selection.selection_columns) > 0:
return selection.selection_columns
return columns
security.declareProtected(ERP5Permissions.View, 'setSelectionStats')
......@@ -616,10 +614,14 @@ class SelectionTool( UniqueObject, SimpleItem ):
domain_tree_mode = 0
report_tree_mode = 1
selection.edit(flat_list_mode=flat_list_mode,domain_tree_mode=domain_tree_mode,
report_tree_mode=report_tree_mode)
# It is better to reset the query when changing the display mode.
params = selection.getSelectionParams()
if 'query' in params: del params['query']
selection.edit(params = params)
referer = request['HTTP_REFERER']
referer = referer.replace('reset=', 'noreset=')
referer = referer.replace('reset:int=', 'noreset:int=')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment