[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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user