Commit a2f5df23 authored by Tatuya Kamada's avatar Tatuya Kamada

Fix the issue that when the sign of a quantity is negative, getAveragePrice...

Fix the issue that when the sign of a quantity is negative, getAveragePrice method returns always 0.0. It will cause a problem, for example in an accounting transaction line. (approved by kazuhiko)


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