[FIX] stock_account: compute total inventory_value when no product is specified

Without this fix, the 'Total' line of the pivot view does not display any inventory value, because there is no __domain as we are not asking the inventory value for any specific product.
This commit is contained in:
David Monjoie 2015-01-13 14:07:06 +01:00
parent 88ace35fa4
commit 2d215db686
1 changed files with 13 additions and 14 deletions

View File

@ -49,8 +49,7 @@ class stock_history(osv.osv):
prod_dict = {}
if 'inventory_value' in fields:
for line in res:
if '__domain' in line:
lines = self.search(cr, uid, line['__domain'], context=context)
lines = self.search(cr, uid, line.get('__domain', []), context=context)
inv_value = 0.0
product_tmpl_obj = self.pool.get("product.template")
lines_rec = self.browse(cr, uid, lines, context=context)