diff --git a/addons/stock/i18n/stock.pot b/addons/stock/i18n/stock.pot index 5c4f564558a..706a734956a 100644 --- a/addons/stock/i18n/stock.pot +++ b/addons/stock/i18n/stock.pot @@ -6099,6 +6099,7 @@ msgstr "" #. module: stock #: code:addons/stock/models/stock_quant.py:0 +#: model:ir.actions.act_window,name:stock.dashboard_open_quants #, python-format msgid "Stock On Hand" msgstr "" diff --git a/addons/stock/models/stock_quant.py b/addons/stock/models/stock_quant.py index a6b1192f36f..27615327ecc 100644 --- a/addons/stock/models/stock_quant.py +++ b/addons/stock/models/stock_quant.py @@ -615,6 +615,10 @@ class StockQuant(models.Model): """ } + target_action = self.env.ref('stock.dashboard_open_quants', False) + if target_action: + action['id'] = target_action.id + if self._is_inventory_mode(): action['view_id'] = self.env.ref('stock.view_stock_quant_tree_editable').id form_view = self.env.ref('stock.view_stock_quant_form_editable').id diff --git a/addons/stock/views/stock_quant_views.xml b/addons/stock/views/stock_quant_views.xml index 1ae0fed8101..45128f812fd 100644 --- a/addons/stock/views/stock_quant_views.xml +++ b/addons/stock/views/stock_quant_views.xml @@ -207,6 +207,11 @@ + + Stock On Hand + {'search_default_internal_loc': 1, 'search_default_productgroup':1, 'search_default_locationgroup':1} + stock.quant + {'search_default_productgroup': 1} [('location_id', 'child_of', active_ids)]