Odoo Help


How to add a default 'group by' filter to tree view?

samir Guesmi
on 9/2/13, 7:17 AM 20,919 views

hi all ,

i have a tree view , i want to show it by default with grouped by (grouped by employee_id)

if someone can help .



Grover Menacho

--Grover Menacho--
| 5 7 8
La Paz, Bolivia
--Grover Menacho--

Systems Engineer + MBA

Grover Menacho
On 10/7/13, 10:46 AM

On your search view you have something like this:

<filter name="group_employee_id" string="Category" icon="terp-partner" context="{'group_by':'employee_id'}"/>

So, on your action you have to send this by context:

<field name="context">{'search_default_group_employee_id': 1}</field>

I tried with just {'group_by': 'employee_id'} in the action context and it works.

Leonardo Donelli
on 9/10/14, 11:54 AM
Ratmil Torres
On 5/6/15, 11:14 AM

What if this treeview is inside a form? Not called from an action.

Good question. I would also like to know.

Limitless Virtual Enterprise, Andre de Kock
on 7/14/15, 3:02 AM

Axel Mendoza

--Axel Mendoza--
| 7 8 8
Camaguey, Cuba
--Axel Mendoza--

DevOps - Full stack - Software Architect - Developer - Technology Integrator

I could help you to develop anything and solve complex problems based on technologies, integrations and tricky stuffs mostly in Python with OpenERP/Odoo, Zato, Django and many others frameworks programming languages and technologies.

I offers consulting services to anyone with an unanswered questions or needs for customizations. Think about it, maybe it's better to have an expert to solve your issues and projects than having a full time employee trying to understand what to do an how

Reach me at aekroft@gmail.com

Axel Mendoza
On 8/7/15, 1:09 PM

I do this in v7 it require an extension of the widget one2many or many2many

Badache Zoubir
On 4/28/16, 5:30 AM

<record id=".............." model="ir.actions.act_window" >

<field name="name">.............</field>

<field name="res_model">.................</field>

<field name="view_type">form</field>

<field name="context">{'group_by':'employee_id'}</field>

<field name="view_mode">tree</field>

<field name="domain">[('active', '=', True)]</field>


Noel Jesús Rivero
On 4/8/16, 10:04 AM

Nice solution

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 9/2/13, 7:17 AM
Seen: 20919 times
Last updated: 4/28/16, 5:30 AM