Skip to content

Commit

Permalink
[FIX] stock: moves link on product form opening wrong view
Browse files Browse the repository at this point in the history
Fixes odoo#2008
  • Loading branch information
rvalyi authored and mart-e committed Aug 27, 2014
1 parent f258332 commit 64f65ee
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions addons/stock/product.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,10 +433,13 @@ def action_view_stock_moves(self, cr, uid, ids, context=None):
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


Expand Down

0 comments on commit 64f65ee

Please sign in to comment.