Community mailing list archives

Re: How to add a PRIORITY default ORDER 'group by' filter to tree view?

- 04/08/2016 00:09:10
Hi Luis,

To give default GROUP BY to the view of the model, you have to define the filter in the search view first. In your case it must be like,

   <filter string="Location" domain="[]" context="{'group_by':'location_id'}" name="group_by_location"/>
   <filter string="Product" domain="[]" context="{'group_by':'product_id'}" name="group_by_product"/>

After this you have to mention the default filter in the context attribute of action(ir.actions.act_window) of the particular model. It must be like,
    <field name="context">{'search_default_group_by_location': 1, 'search_default_group_by_product': 1}</field>

Hope it will work !

Thanks & Regards

On Fri, Apr 8, 2016 at 9:06 AM, Juan Vidal Luis <> wrote:

Im trying to GROUP BY location_id first and then by product_id but so far, not working:

{'search_default_group_by_location': 1, 'search_default_group_by_product': 1}

All the time records are grouped by product and the location.

How can I change the priority of the ORDER BY?

Post to: