Commit 36f6524c authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

fix wrong conditions to skip sorting.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@30448 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 94dc7a6b
......@@ -85,7 +85,7 @@ class FIFO(DeliverySolver):
Returns a list of simulation movement sorted from the last order.
"""
simulation_movement_list = self.simulation_movement_list[:]
if len(simulation_movement_list):
if len(simulation_movement_list) > 1:
simulation_movement_list.sort(
key=lambda x:x.getExplainationValue().getStartDate(), reverse=True)
return simulation_movement_list
......@@ -48,7 +48,7 @@ class LIFO(FIFO):
Returns a list of simulation movement sorted from the first order.
"""
simulation_movement_list = self.simulation_movement_list[:]
if len(simulation_movement_list):
if len(simulation_movement_list) > 1:
simulation_movement_list.sort(
key=lambda x:x.getExplainationValue().getStartDate())
return simulation_movement_list
......@@ -73,6 +73,6 @@ class MinPrice(FIFO):
Returns a list of simulation movement sorted from the lower price.
"""
simulation_movement_list = self.simulation_movement_list[:]
if len(simulation_movement_list):
if len(simulation_movement_list) > 1:
simulation_movement_list.sort(key=lambda x:x.getPrice())
return simulation_movement_list
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