Help

3

Dynamic domain for multiple IDs

Avatar
Vasiliy Birukov

Is it possible define in form view dynamic domain for multiple IDs, like (this don't work):

<field name="category_ids"/>
<field name="task_id" domain="[('category_id','in',category_ids)]"

For static domain it work:

<field name="category_ids"/>
<field name="task_id" domain="[('category_id','in',[1,2])]"

الصورة الرمزية
تجاهل
2 الإجابات
1
Avatar
Ivan
Best Answer

It should be [('category_id','in',category_ids[0][2])].  I presume category_ids is either one2many or many2many fields.  Entries in those type of fields are usually represented as [(6, 0, [id1, id2, ...])].  By getting category_ids[0][2] you'll get the [id1, id2, ...] part.

1 تعليق
الصورة الرمزية
تجاهل
Avatar
Vasiliy Birukov
-

Thank you! That work :)

0
Avatar
Ankit H Gandhi(AHG)
Best Answer

Hello Vasiliy Birukov,

I think you are written wrong syntax.

so i will be write this line will be help you.

<field name="task_id" domain="[('category_id', 'in', (category_ids))]" />

Regards,

Ankit H Gandhi

1 تعليق
الصورة الرمزية
تجاهل
Avatar
Vasiliy Birukov
-

Wrong propose. Don't work :(