Commit 624f2f19 authored by Julien Muchembled's avatar Julien Muchembled

ERP5Form: when rendering the listbox of relation fields, apply parameter_list last

Apart from some code cleanup, it can override catalog_index.
parent d69602da
...@@ -1283,29 +1283,25 @@ class SelectionTool( BaseTool, SimpleItem ): ...@@ -1283,29 +1283,25 @@ class SelectionTool( BaseTool, SimpleItem ):
# Save the current REQUEST form # Save the current REQUEST form
# We can't put FileUpload instances because we can't pickle them # We can't put FileUpload instances because we can't pickle them
saved_form_data = {} saved_form_data = {key: value
for key, value in REQUEST.form.items(): for key, value in REQUEST.form.items()
if not isinstance(value, FileUpload): if not isinstance(value, FileUpload)}
saved_form_data[key] = value
kw = {
base_category = None 'dialog_id': dialog_id,
kw = {} 'selection_name': selection_name,
kw['dialog_id'] = dialog_id 'selection_index': 0, # We start on the first page
kw['selection_name'] = selection_name 'field_id': field.id,
kw['selection_index'] = 0 # We start on the first page 'reset': 0,
kw['field_id'] = field.id 'base_category': field.get_value( 'base_category'),
parameter_list = field.get_value('parameter_list') 'form_id': form_id,
if len(parameter_list) > 0: field.get_value('catalog_index'): field_value,
for k,v in parameter_list: 'portal_status_message': portal_status_message,
kw[k] = v 'saved_form_data': saved_form_data,
kw['reset'] = 0 'ignore_layout': int(REQUEST.get('ignore_layout', 0)),
kw['base_category'] = field.get_value( 'base_category') 'ignore_hide_rows': 1,
kw['form_id'] = form_id }
kw[field.get_value('catalog_index')] = field_value kw.update(field.get_value('parameter_list'))
kw['portal_status_message'] = portal_status_message
kw['saved_form_data'] = saved_form_data
kw['ignore_layout'] = int(REQUEST.get('ignore_layout', 0))
kw['ignore_hide_rows'] = 1
# remove ignore_layout parameter from cancel_url otherwise we # remove ignore_layout parameter from cancel_url otherwise we
# will have two ignore_layout parameters after clicking cancel # will have two ignore_layout parameters after clicking cancel
# button. # button.
......
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