Fix average cost price when product quantity is negative

issue5038
review15721002
This commit is contained in:
Sergi Almacellas Abellana committed 2015-10-14 15:45:21 +02:00
1 parent 77b3f1150f
commit f6cc35f698
1 file changed
+1 -1
+1 -1
View File
@@ -555,7 +555,7 @@ class Move(Workflow, ModelSQL, ModelView):
product_qty = product.quantity
else:
product_qty = product.template.quantity
product_qty = Decimal(str(product_qty))
product_qty = Decimal(str(max(product_qty, 0)))
# convert wrt currency
with Transaction().set_context(date=self.effective_date):
unit_price = Currency.compute(self.currency, self.unit_price,