Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
8 Odpovědi
108821 Zobrazení

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

Avatar
Zrušit
Nejlepší odpověď
<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>
Avatar
Zrušit
Nejlepší odpověď

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>
Avatar
Zrušit

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

Nejlepší odpověď

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

Avatar
Zrušit

Good question. I would also like to know.

did you found the answer ?

Did anyone get solution of this question??

Nejlepší odpověď
<tree string="" default_order="field_name">
<field name=""/>
<field name=""/>
</tree>
Avatar
Zrušit
Nejlepší odpověď

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

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

Avatar
Zrušit
Nejlepší odpověď

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

Avatar
Zrušit
Nejlepší odpověď

Nice solution

Avatar
Zrušit
Nejlepší odpověď

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

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
0
kvě 24
1546
1
čvc 21
2595
0
dub 16
4078
1
kvě 15
3817
2
bře 15
4635