diff --git a/product/ERP5/DeliverySolver/FIFO.py b/product/ERP5/DeliverySolver/FIFO.py index e5e40682aaf26c786cf946d7efcacd6cb8ee2497..ea0392fa5ce8511df4048df03e86f63b0b2c600a 100644 --- a/product/ERP5/DeliverySolver/FIFO.py +++ b/product/ERP5/DeliverySolver/FIFO.py @@ -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 diff --git a/product/ERP5/DeliverySolver/LIFO.py b/product/ERP5/DeliverySolver/LIFO.py index 533b0b84b3d2a12434835a6ed9ec6bfbed46616a..916c61738988b459c28c7d5ebd6c96343b600edb 100644 --- a/product/ERP5/DeliverySolver/LIFO.py +++ b/product/ERP5/DeliverySolver/LIFO.py @@ -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 diff --git a/product/ERP5/DeliverySolver/MinPrice.py b/product/ERP5/DeliverySolver/MinPrice.py index 043f822fff0bd21c74c3633baaaebb02b2206b9b..8c0c18cfaee69cc160698e7d6d4c3f316fe8edea 100644 --- a/product/ERP5/DeliverySolver/MinPrice.py +++ b/product/ERP5/DeliverySolver/MinPrice.py @@ -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