Commit 8c2eb165 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

a small optimisation.

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