I'm using Odoo 13. My requirement is quite simple. I have a list of incidents. When I land on the tree view, I want to see a group_by filter that I have predefined to be applied by default. I've seen others implement this and done everything right, but still it doesn't work. I can see the "Stage" filter in the group by dropdown but it doesn't get applied by default. I am pasting the code here for you to have a look. Please let me know if I'm missing something.
<record model="ir.ui.view" id="view_incident_incident_search">
<field name="model">incident.incident</field>
<field name="arch" type="xml">
<search>
<filter name="filter_group_by_stage" string="Stage" context="{'group_by': 'stage_id'}"/>
</search>
</field>
</record>
<record model="ir.actions.act_window" id="action_incident_window">
<field name="name">Incidents</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">incident.incident</field>
<field name="view_mode">tree,form,activity</field>
<field name="domain">[]</field>
<field name="search_view_id" ref="view_incident_incident_search"/>
<field name="context">{'default_search_filter_group_by_stage': 1}</field>
</record>