From: Raphaƫl Valyi Date: Tue, 26 Aug 2014 22:07:24 +0000 (-0300) Subject: [FIX] stock: moves link on product form opening wrong view X-Git-Tag: 8.0.0~235 X-Git-Url: http://git.inspyration.org/?a=commitdiff_plain;h=64f65ee8f68f2f87817a49dd2f5e206dad51add0;p=odoo%2Fodoo.git [FIX] stock: moves link on product form opening wrong view Fixes #2008 --- diff --git a/addons/stock/product.py b/addons/stock/product.py index 7289e8d..bb60b77 100644 --- a/addons/stock/product.py +++ b/addons/stock/product.py @@ -433,10 +433,13 @@ class product_template(osv.osv): products = self._get_products(cr, uid, ids, context=context) result = self._get_act_window_dict(cr, uid, 'stock.act_product_stock_move_open', context=context) if len(ids) == 1 and len(products) == 1: - result['context'] = "{'default_product_id': " + str(products[0]) + ", 'search_default_product_id': " + str(products[0]) + "}" + ctx = "{'tree_view_ref':'stock.view_move_tree', \ + 'default_product_id': %s, 'search_default_product_id': %s}" \ + % (products[0], products[0]) + result['context'] = ctx else: result['domain'] = "[('product_id','in',[" + ','.join(map(str, products)) + "])]" - result['context'] = "{}" + result['context'] = "{'tree_view_ref':'stock.view_move_tree'}" return result