Commit aedd7369 authored by Sebastien Robin's avatar Sebastien Robin

make sure there is some quantity before using the / operator

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@6311 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1f12013a
......@@ -785,7 +785,9 @@ class FakeMovement:
"""
Return average price
"""
return (self.getAddPrice() / self.getAddQuantity())
if self.getAddQuantity()>0:
return (self.getAddPrice() / self.getAddQuantity())
return 0.0
def getAddQuantity(self):
"""
......
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