Commit 5b149e64 authored by Yusei Tahara's avatar Yusei Tahara

Sort composed trade model line list by int_index if all items in the

list have int_index value. This solves undetermined order problem.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@36047 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0d147e83
......@@ -205,6 +205,11 @@ class TradeCondition(Path, Transformation):
# at least return original lines retrieved
final_list = trade_model_line_composed_list
### If all items in final_list has int_index value, then sort it by
### int_index to solve undetermined order problem.
if len([item for item in final_list if not item.getIntIndex()])==0:
final_list.sort(lambda a, b:cmp(a.getIntIndex(), b.getIntIndex()))
return final_list
security.declareProtected(Permissions.AccessContentsInformation,
......
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