diff --git a/addons/stock_account/report/stock_history_views.xml b/addons/stock_account/report/stock_history_views.xml index 888ac577e26..085a73fe319 100644 --- a/addons/stock_account/report/stock_history_views.xml +++ b/addons/stock_account/report/stock_history_views.xml @@ -58,4 +58,10 @@ + + Stock History + stock.history + form + tree,graph,pivot + diff --git a/addons/stock_account/wizard/wizard_valuation_history.py b/addons/stock_account/wizard/wizard_valuation_history.py index 889db533a83..4da1ffe5d4d 100644 --- a/addons/stock_account/wizard/wizard_valuation_history.py +++ b/addons/stock_account/wizard/wizard_valuation_history.py @@ -19,12 +19,19 @@ class WizardValuationHistory(models.TransientModel): history_date=self.date, search_default_group_by_product=True, search_default_group_by_location=True) - return { - 'domain': "[('date', '<=', '" + self.date + "')]", - 'name': _('Stock Value At Date'), - 'view_type': 'form', - 'view_mode': 'tree', - 'res_model': 'stock.history', - 'type': 'ir.actions.act_window', - 'context': ctx, - } + + action = self.env['ir.model.data'].xmlid_to_object('stock_account.action_stock_history') + if not action: + action = { + 'view_type': 'form', + 'view_mode': 'tree,graph,pivot', + 'res_model': 'stock.history', + 'type': 'ir.actions.act_window', + } + else: + action = action[0].read()[0] + + action['domain'] = "[('date', '<=', '" + self.date + "')]" + action['name'] = _('Stock Value At Date') + action['context'] = ctx + return action