Odoo Help

3

Dynamic domain for multiple IDs

By
Vasiliy Birukov
on 1/8/15, 4:03 AM 1,490 views

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])]"

1
Ivan
On 1/8/15, 6:54 AM

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.

Thank you! That work :)

Vasiliy Birukov
on 1/9/15, 2:21 AM
0
Ankit H Gandhi(AHG)
On 1/8/15, 4:18 AM

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

Wrong propose. Don't work :(

Vasiliy Birukov
on 1/9/15, 2:15 AM

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: 1/8/15, 4:03 AM
Seen: 1490 times
Last updated: 5/6/16, 5:39 AM