Skip to content
Permalink
Browse files

[FIX] stock: inventory value

- Go to Inventory > Reports > Inventory Valuation
- Select the pivot view

The top row (containing the Total) has an empty 'Inventory Value'.

This is because there is no domain on the line, so it is skipped.

We fall back on the global domain instead.

opw-1933191
  • Loading branch information...
nim-odoo committed Feb 20, 2019
1 parent 8183f92 commit daf12c96ae96195f5258ecb0b766eef04ca0021f
Showing with 5 additions and 6 deletions.
  1. +5 −6 addons/stock/models/stock_quant.py
@@ -110,12 +110,11 @@ def read_group(self, domain, fields, groupby, offset=0, limit=None, orderby=Fals
res = super(Quant, self).read_group(domain, fields, groupby, offset=offset, limit=limit, orderby=orderby, lazy=lazy)
if 'inventory_value' in fields:
for line in res:
if '__domain' in line:
lines = self.search(line['__domain'])
inv_value = 0.0
for line2 in lines:
inv_value += line2.inventory_value
line['inventory_value'] = inv_value
lines = self.search(line.get('__domain', domain))
inv_value = 0.0
for line2 in lines:
inv_value += line2.inventory_value
line['inventory_value'] = inv_value
return res

@api.multi

0 comments on commit daf12c9

Please sign in to comment.
You can’t perform that action at this time.