[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
This commit is contained in:
Nicolas Lempereur
2017-01-09 16:53:40 +01:00
parent 0b2bb25084
commit 41c64a89a5
+1 -1
View File
@@ -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,