تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
8 الردود
108971 أدوات العرض

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>

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
0
مايو 24
1596
1
يوليو 21
2623
0
أبريل 16
4125
1
مايو 15
3852
2
مارس 15
4684