Commit ec758575 authored by Nicolas Delaby's avatar Nicolas Delaby

Order matters in MatrixBox, sort only a copy of cell_key

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@40182 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a3ac185f
......@@ -102,14 +102,17 @@ for line in listbox:\n
title=product.getTitle(),\n
)\n
per_resource_line_dict[key] = trade_document_line\n
if len(line["variation_category_list"]):\n
trade_document_line.setVariationCategoryList(trade_document_line.getVariationCategoryList()+line["variation_category_list"])\n
variation_category_list = line["variation_category_list"]\n
if variation_category_list:\n
variation_category_list.sort()\n
trade_document_line.setVariationCategoryList(trade_document_line.getVariationCategoryList()+variation_category_list)\n
base_id = \'movement\'\n
cell_key_list = list(trade_document_line.getCellKeyList(base_id=base_id))\n
cell_key_list.sort()\n
for cell_key in cell_key_list:\n
if cell_key == line["variation_category_list"]:\n
cell = trade_document_line.newCell(base_id=base_id, \\\n
sorted_cell_key = cell_key[:]\n
sorted_cell_key.sort()\n
if sorted_cell_key == variation_category_list:\n
cell = trade_document_line.newCell(base_id=base_id,\n
portal_type=cell_portal_type, *cell_key)\n
cell.edit(mapped_value_property_list=[\'price\',\'quantity\'],\n
price=line[\'price\'], quantity=line[\'quantity\'],\n
......@@ -122,7 +125,6 @@ for line in listbox:\n
quantity_unit=line[\'quantity_unit\']\n
)\n
\n
\n
return context.Base_redirect(kw[\'form_id\'], keep_items=dict(\n
portal_status_message=translateString(\'%s Created.\' %(line_portal_type,))))\n
</string> </value>
......@@ -188,11 +190,12 @@ return context.Base_redirect(kw[\'form_id\'], keep_items=dict(\n
<string>key</string>
<string>trade_document_line</string>
<string>_write_</string>
<string>len</string>
<string>variation_category_list</string>
<string>base_id</string>
<string>list</string>
<string>cell_key_list</string>
<string>cell_key</string>
<string>sorted_cell_key</string>
<string>_apply_</string>
<string>cell</string>
<string>dict</string>
......
1026
\ No newline at end of file
1027
\ 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