[FIX] stock: moves link on product form opening wrong view

Fixes #2008
This commit is contained in:
Raphaël Valyi 2014-08-26 19:07:24 -03:00 committed by Martin Trigaux
parent f2583323a9
commit 64f65ee8f6
1 changed files with 5 additions and 2 deletions

View File

@ -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