Commit 085c4f47 authored by Jérome Perrin's avatar Jérome Perrin

QuantitySignMovementGroup must group 0 quantity with both positive and negative quantities


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3795 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 27c2824e
......@@ -308,7 +308,9 @@ class QuantitySignMovementGroup(RootMovementGroup):
def __init__(self, movement, **kw):
RootMovementGroup.__init__(self, movement=movement, **kw)
quantity = movement.getQuantity()
if quantity >= 0:
if quantity == 0:
self.sign = 0
elif quantity > 0:
self.sign = 1
else:
self.sign = -1
......@@ -316,13 +318,13 @@ class QuantitySignMovementGroup(RootMovementGroup):
def test(self, movement):
quantity = movement.getQuantity()
if quantity >= 0:
if quantity == 0 or self.sign == 0 :
return 1
if quantity > 0:
sign = 1
else:
sign = -1
if self.sign == sign:
return 1
return 0
return self.sign == sign
allow_class(QuantitySignMovementGroup)
......
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