summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorNicolas Lempereur <nle@odoo.com>2017-01-06 16:32:29 +0100
committerNicolas Lempereur <nle@odoo.com>2017-01-09 16:53:40 +0100
commit41c64a89a5bdb89cef4a7b542c5f0c8db853ddea (patch)
treefc20b431e1a5c8a01744923cc80daad93812f486 /addons
parent0b2bb250840ef666608ba3c53d6185eb6b6d7acc (diff)
[FIX] stock: use avg for cost in group by report
When doing pivot table data visualization, the Unit Cost of several lines are summed up but there has more meaning if they were averaged. This will probably still not be perfect (such as averaging two line with different quantities the quantities would not be taken into accounts) but it is already slightly better. opw-694068
Diffstat (limited to 'addons')
-rw-r--r--addons/stock/models/stock_quant.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/stock/models/stock_quant.py b/addons/stock/models/stock_quant.py
index b5512c6d6e0..bc92016d5f3 100644
--- a/addons/stock/models/stock_quant.py
+++ b/addons/stock/models/stock_quant.py
@@ -44,7 +44,7 @@ class Quant(models.Model):
lot_id = fields.Many2one(
'stock.production.lot', 'Lot/Serial Number',
index=True, ondelete="restrict", readonly=True)
- cost = fields.Float('Unit Cost')
+ cost = fields.Float('Unit Cost', group_operator='avg')
owner_id = fields.Many2one(
'res.partner', 'Owner',
index=True, readonly=True,