Commit 42ac5ca2 authored by Yusei Tahara's avatar Yusei Tahara

If movement_list is empty, then return an empty list and prevent

raising exception when sorting.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@26506 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 867e6044
......@@ -52,6 +52,9 @@ class PropertyAssignmentMovementGroup(MovementGroup):
return True, property_dict
def _separate(self, movement_list):
if not movement_list:
return []
property_dict = {}
for prop in self.getTestedPropertyList():
......
......@@ -62,6 +62,9 @@ class QuantitySignMovementGroup(MovementGroup):
return property_dict
def _separate(self, movement_list):
if not movement_list:
return []
tmp_list = [[], [], []] # -1:minus, 0:zero, 1:plus
for movement in movement_list:
tmp_list[cmp(movement.getQuantity(), 0)].append(movement)
......
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