Community mailing list archives

community@mail.odoo.com

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

by
Juan
- 04/08/2016 00:26:38
Hello Nikesh,

Sadly just noted that Odoo takes the first filet as pivot and so on... so I only changed the order of the filter and it worked...

Thanks a bunch for the help

On Thu, Apr 7, 2016 at 10:11 PM, nikesh panoth <nikeshtrikaripur@gmail.com> wrote:
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 <juanvidal0123@gmail.com> wrote:
Hello,

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?

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe


_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe