From 5537c5a13c31979e0eaa0132f03056632d072d60 Mon Sep 17 00:00:00 2001 From: Lionel Sausin Date: Fri, 11 Mar 2016 17:58:36 +0100 Subject: [PATCH] [FIX] stock_account: do not sum price unit The view yields one line per stock move, with a price/unit on each line. It doesn't make sense to sum price/units, the avg will be only meaningful when grouping per product but it's correct in the default state. Closes #11309 --- addons/stock_account/wizard/stock_valuation_history.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock_account/wizard/stock_valuation_history.py b/addons/stock_account/wizard/stock_valuation_history.py index 1bbe5a81968..d3a53b1046a 100644 --- a/addons/stock_account/wizard/stock_valuation_history.py +++ b/addons/stock_account/wizard/stock_valuation_history.py @@ -108,7 +108,7 @@ class stock_history(osv.osv): 'product_categ_id': fields.many2one('product.category', 'Product Category', required=True), 'quantity': fields.float('Product Quantity'), 'date': fields.datetime('Operation Date'), - 'price_unit_on_quant': fields.float('Value'), + 'price_unit_on_quant': fields.float('Value', group_operator='avg'), 'inventory_value': fields.function(_get_inventory_value, string="Inventory Value", type='float', readonly=True), 'source': fields.char('Source') }