diff --git a/contract_forecast/models/contract.py b/contract_forecast/models/contract.py index a4ab408d..9a1f6344 100644 --- a/contract_forecast/models/contract.py +++ b/contract_forecast/models/contract.py @@ -11,11 +11,14 @@ class AccountAnalyticAccount(models.Model): @api.multi def action_show_contract_forecast(self): self.ensure_one() + context = {'search_default_groupby_date_invoice': True} + context.update(self.env.context) + return { "type": "ir.actions.act_window", "name": _("Contract Forecast"), "res_model": "contract.line.forecast.period", "domain": [("contract_id", "=", self.id)], "view_mode": "pivot,tree", - "context": self.env.context, + "context": context, } diff --git a/contract_forecast/views/contract_line_forecast_period.xml b/contract_forecast/views/contract_line_forecast_period.xml index 8fe5d85a..381cc47c 100644 --- a/contract_forecast/views/contract_line_forecast_period.xml +++ b/contract_forecast/views/contract_line_forecast_period.xml @@ -19,7 +19,7 @@ + context="{'group_by':'date_invoice:day'}"/> @@ -48,8 +48,8 @@ contract.line.forecast.period - - + +