From 64f65ee8f68f2f87817a49dd2f5e206dad51add0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Valyi?= Date: Tue, 26 Aug 2014 19:07:24 -0300 Subject: [PATCH] [FIX] stock: moves link on product form opening wrong view Fixes #2008 --- addons/stock/product.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/addons/stock/product.py b/addons/stock/product.py index 7289e8d4538..bb60b77ba1d 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