From a7d1740e475c44b50d0cc6ce6f43e9f142e99334 Mon Sep 17 00:00:00 2001 From: Simon Lejeune Date: Thu, 28 Sep 2017 16:43:57 +0200 Subject: [PATCH] [FIX] stock_account: restore the valuation action Introduced in rev 0f7d2d7cf7aaf8f3349c9733e970f9ae8e2b90b4 and wrongly removed in ce4da0531dc18d68f0943e46a1ebe779761f8013 --- addons/stock_account/models/product.py | 6 +-- addons/stock_account/views/product_views.xml | 41 ++++++++++++++++++++ 2 files changed, 44 insertions(+), 3 deletions(-) diff --git a/addons/stock_account/models/product.py b/addons/stock_account/models/product.py index 10d80789938..883a4b48ff9 100644 --- a/addons/stock_account/models/product.py +++ b/addons/stock_account/models/product.py @@ -86,7 +86,7 @@ class ProductTemplate(models.Model): @api.multi def action_open_product_moves(self): self.ensure_one() - action = self.env.ref('stock_account.product_valuation_action').read()[0] + action = self.env.ref('stock_account.stock_move_valuation_action').read()[0] action['domain'] = [('product_tmpl_id', '=', self.id)] action['context'] = { 'search_default_outgoing': True, @@ -185,8 +185,8 @@ class ProductProduct(models.Model): @api.multi def action_open_product_moves(self): self.ensure_one() - action = self.env.ref('stock_account.product_valuation_action').read()[0] - action['domain'] = [('id', '=', self.id)] + action = self.env.ref('stock_account.stock_move_valuation_action').read()[0] + action['domain'] = [('product_id', '=', self.id)] action['context'] = { 'search_default_outgoing': True, 'search_default_incoming': True, diff --git a/addons/stock_account/views/product_views.xml b/addons/stock_account/views/product_views.xml index d21e5f3ee0f..1bba3652044 100644 --- a/addons/stock_account/views/product_views.xml +++ b/addons/stock_account/views/product_views.xml @@ -137,5 +137,46 @@ + + + + stock.move.tree.valuation + stock.move + + + + + + + + + + + + + + + + + + + + + + + + Stock Moves + stock.move + ir.actions.act_window + form + + + {'search_default_outgoing': 1, 'search_default_incoming': 1, 'search_default_done': 1, 'search_default_group_by_product': 1} + +

+ Click to create a stock movement. +

+
+