Odoo Help

1

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

By
samir Guesmi
on 9/2/13, 7:17 AM 22,163 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 .

thanks

13
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.

MONK Software, Leonardo Donelli
on 9/10/14, 11:54 AM
2
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
1
Axel Mendoza
On 8/7/15, 1:09 PM

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

0
Bulgantamir
On 8/16/17, 5:17 AM
<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>
0
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>

</record>

0
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.

Register

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)

Stats

Asked: 9/2/13, 7:17 AM
Seen: 22163 times
Last updated: 8/16/17, 5:17 AM