From 7e9b043113e0a46f3921d24bedf73b60269cb915 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 16 Aug 2012 16:04:01 +0200 Subject: [PATCH] Use the right quantity when updating the cost_price review462002 --- move.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/move.py b/move.py index 066af7b922..a6b057b843 100644 --- a/move.py +++ b/move.py @@ -394,7 +394,11 @@ class Move(ModelSQL, ModelView): qty = uom_obj.compute_qty(uom, quantity, product.default_uom) qty = Decimal(str(qty)) - product_qty = Decimal(str(product.template.quantity)) + if hasattr(product_obj, 'cost_price'): + product_qty = product.quantity + else: + product_qty = product.template.quantity + product_qty = Decimal(str(product_qty)) # convert wrt currency with Transaction().set_context(date=date): unit_price = currency_obj.compute(currency.id, unit_price,