From 6fd5c5a8ea2b78e8a7ba97adf5aa530c10caea60 Mon Sep 17 00:00:00 2001 From: Prakash Prajapati Date: Thu, 4 Jan 2018 17:29:32 +0530 Subject: [PATCH] [ADD] stock_account: search view improvement inventory valuation search view was the product's one. This commit add new filters to the inventory valuation search view and removes the ones specific to products. It also rename the search view title to the same label as the menu action PR:22085 TASK:38933 --- addons/stock_account/views/product_views.xml | 3 ++- .../stock_account/views/stock_account_views.xml | 17 +++++++++++++++++ .../wizard/stock_quantity_history.py | 4 +++- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/addons/stock_account/views/product_views.xml b/addons/stock_account/views/product_views.xml index 69ce7f4910f..fac4a4e70fd 100644 --- a/addons/stock_account/views/product_views.xml +++ b/addons/stock_account/views/product_views.xml @@ -91,7 +91,7 @@ - Product Valuation + Inventory Valuation ir.actions.act_window product.product tree,form @@ -99,6 +99,7 @@ [('type', '=', 'product'), ('qty_available', '!=', 0)] {'company_owned': True} +

Create a new product valuation diff --git a/addons/stock_account/views/stock_account_views.xml b/addons/stock_account/views/stock_account_views.xml index 0ee6b9bd775..1e3d84fc6b7 100644 --- a/addons/stock_account/views/stock_account_views.xml +++ b/addons/stock_account/views/stock_account_views.xml @@ -83,6 +83,23 @@ + + + product.product + product.product + + + + + + + + + + + + + Valuation Report stock.quantity.history diff --git a/addons/stock_account/wizard/stock_quantity_history.py b/addons/stock_account/wizard/stock_quantity_history.py index fe920a457bb..406301ea13a 100644 --- a/addons/stock_account/wizard/stock_quantity_history.py +++ b/addons/stock_account/wizard/stock_quantity_history.py @@ -15,16 +15,18 @@ class StockQuantityHistory(models.TransientModel): if self.compute_at_date: tree_view_id = self.env.ref('stock_account.view_stock_product_tree2').id form_view_id = self.env.ref('stock.product_form_view_procurement_button').id + search_view_id = self.env.ref('stock_account.view_inventory_valuation_search').id # We pass `to_date` in the context so that `qty_available` will be computed across # moves until date. action = { 'type': 'ir.actions.act_window', 'views': [(tree_view_id, 'tree'), (form_view_id, 'form')], 'view_mode': 'tree,form', - 'name': _('Products'), + 'name': _('Inventory Valuation'), 'res_model': 'product.product', 'domain': "[('type', '=', 'product'), ('qty_available', '!=', 0)]", 'context': dict(self.env.context, to_date=self.date, company_owned=True), + 'search_view_id': search_view_id } return action else: