Skip to content

Commit

Permalink
[FIX] stock: inventory value
Browse files Browse the repository at this point in the history
- 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

closes #31280
  • Loading branch information
nim-odoo committed Feb 20, 2019
1 parent 8183f92 commit 0191b65
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions addons/stock/models/stock_quant.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0191b65

Please sign in to comment.