Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
8 Відповіді
109035 Переглядів

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

Аватар
Відмінити
Найкраща відповідь
<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>
Аватар
Відмінити
Найкраща відповідь

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.

Найкраща відповідь

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

Аватар
Відмінити

Good question. I would also like to know.

did you found the answer ?

Did anyone get solution of this question??

Найкраща відповідь
<tree string="" default_order="field_name">
<field name=""/>
<field name=""/>
</tree>
Аватар
Відмінити
Найкраща відповідь

Should be super simple in all the recent versions of ODOO.

https://youtube.com/shorts/-X-7NHL4dJY

Аватар
Відмінити
Найкраща відповідь

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

Аватар
Відмінити
Найкраща відповідь

Nice solution

Аватар
Відмінити
Найкраща відповідь

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

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
0
трав. 24
1619
1
лип. 21
2634
0
квіт. 16
4144
1
трав. 15
3858
2
бер. 15
4697