[MERGE] lp:920841 (stock: fix bug in upstream traceability)
authorRaphael Collet <rco@openerp.com>
Mon, 30 Jan 2012 14:17:11 +0000 (15:17 +0100)
committerRaphael Collet <rco@openerp.com>
Mon, 30 Jan 2012 14:17:11 +0000 (15:17 +0100)
bzr revid: rco@openerp.com-20120130141711-0osbxi8igon9v6d3

1  2 
addons/stock/wizard/stock_traceability.py

@@@ -47,7 -47,8 +47,8 @@@ class action_traceability(osv.osv_memor
          obj = self.pool.get('stock.move')
          ids = obj.search(cr, uid, [(field, 'in',lot_id)])
          cr.execute('select id from ir_ui_view where model=%s and field_parent=%s and type=%s', ('stock.move', type1, 'tree'))
-         view_id = cr.fetchone()[0]
 -        view_id = cr.fetchone()
 -        view_id = view_id and view_id[0] or False
++        view_ids = cr.fetchone()
++        view_id = view_ids and view_ids[0] or False
          value = {
              'domain': "[('id','in',["+','.join(map(str, ids))+"])]",
              'name': ((type1=='move_history_ids2') and _('Upstream Traceability')) or _('Downstream Traceability'),