Commit 0963e805 authored by Nicolas Delaby's avatar Nicolas Delaby

If listbox value is read from request it returns a dict, from parameters, this is a list.

This patch address this issue, to unify the parsing of listbox value

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@45104 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1a1654f6
......@@ -53,11 +53,21 @@
<value> <string>from Products.ERP5Type.Message import translateString\n
\n
request= context.REQUEST\n
\n
if not listbox:\n
listbox = request.get(\'listbox\', [])\n
if isinstance(listbox, dict):\n
# structure of listbox value is different than the one fetch from parameters\n
repaired_listbox = []\n
for key in listbox:\n
item = listbox[key]\n
item[\'listbox_key\'] = key\n
repaired_listbox.append(item)\n
listbox = repaired_listbox\n
\n
line_list = context.Delivery_getSolverDecisionList(listbox=listbox)\n
for listbox_key in listbox:\n
listbox_dict = listbox[listbox_key]\n
for listbox_dict in listbox:\n
listbox_key = listbox_dict[\'listbox_key\']\n
line = [x for x in line_list if x.getPath() == listbox_key][0]\n
uid = line.getUid()\n
for property in (\'solver\', \'solver_configuration\', \'delivery_solver\', \'comment\',):\n
......
152
\ No newline at end of file
153
\ No newline at end of file
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