[FIX] stock_account: stock valuation report without result
This is related to rev. 55b7f15ee2
Prevent crash when there is no line to display
in the stock valuation report
Reporting > Warehouse > Stock Valuation.
Like when there is not yet any data, or the filter gives no result
opw-643748
This commit is contained in:
parent
49f2514a9d
commit
bdf980e4b4
|
@ -56,8 +56,10 @@ class stock_history(osv.osv):
|
||||||
for product_id in ids:
|
for product_id in ids:
|
||||||
line_ids.add(product_id)
|
line_ids.add(product_id)
|
||||||
line_ids = list(line_ids)
|
line_ids = list(line_ids)
|
||||||
cr.execute('SELECT id, product_id, price_unit_on_quant, company_id, quantity FROM stock_history WHERE id in %s', (tuple(line_ids),))
|
lines_rec = {}
|
||||||
lines_rec = cr.dictfetchall()
|
if line_ids:
|
||||||
|
cr.execute('SELECT id, product_id, price_unit_on_quant, company_id, quantity FROM stock_history WHERE id in %s', (tuple(line_ids),))
|
||||||
|
lines_rec = cr.dictfetchall()
|
||||||
lines_dict = dict((line['id'], line) for line in lines_rec)
|
lines_dict = dict((line['id'], line) for line in lines_rec)
|
||||||
product_ids = list(set(line_rec['product_id'] for line_rec in lines_rec))
|
product_ids = list(set(line_rec['product_id'] for line_rec in lines_rec))
|
||||||
products_rec = self.pool['product.product'].read(cr, uid, product_ids, ['cost_method', 'product_tmpl_id'], context=context)
|
products_rec = self.pool['product.product'].read(cr, uid, product_ids, ['cost_method', 'product_tmpl_id'], context=context)
|
||||||
|
|
Loading…
Reference in New Issue