From 0eec54cae0041537da166f75b5d35388546cf6b9 Mon Sep 17 00:00:00 2001 From: Simon Lejeune Date: Thu, 22 Feb 2018 17:45:37 +0100 Subject: [PATCH] [FIX] stock_account: stock_value and depends stock value should be recomputed when the standard price change it is not optimal since it is updated in fifo after a delivery but needed when working with standard cost method remaining_value should also be part of the depends since the current value depends on it --- addons/stock_account/models/product.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock_account/models/product.py b/addons/stock_account/models/product.py index a24f3b92726..f159c103855 100644 --- a/addons/stock_account/models/product.py +++ b/addons/stock_account/models/product.py @@ -176,7 +176,7 @@ class ProductProduct(models.Model): return sum(moves.mapped('remaining_value')) @api.multi - @api.depends('stock_move_ids.product_qty', 'stock_move_ids.state', 'product_tmpl_id.cost_method') + @api.depends('stock_move_ids.product_qty', 'stock_move_ids.state', 'stock_move_ids.remaining_value', 'product_tmpl_id.cost_method', 'product_tmpl_id.standard_price') def _compute_stock_value(self): for product in self: if product.cost_method in ['standard', 'average']: