From 76769a071d14918d40f8390bb0c9a85dc7013d78 Mon Sep 17 00:00:00 2001 From: agaldona Date: Wed, 24 Aug 2016 12:56:44 +0200 Subject: [PATCH] [IMP] mrp_production_real_cost: product_price_update_production_done --- mrp_production_real_cost/models/stock_move.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mrp_production_real_cost/models/stock_move.py b/mrp_production_real_cost/models/stock_move.py index 8118b8715..011cd28fa 100644 --- a/mrp_production_real_cost/models/stock_move.py +++ b/mrp_production_real_cost/models/stock_move.py @@ -49,7 +49,7 @@ class StockMove(models.Model): if (current_available + moved) <= 0: return 0.0 return ( - (current_value + cost) / + (current_value + (cost * moved)) / (current_available + moved) ) @@ -67,7 +67,7 @@ class StockMove(models.Model): product_data['available'] = product.qty_available product_data['price'] = product.standard_price product_data['moved'] = 0.0 - product_data['cost'] = move.production_id.real_cost + product_data['cost'] = move.production_id.unit_real_cost if move.state == 'done': product_data['available'] -= move.product_qty product_data['moved'] += move.product_qty