Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
3 ตอบกลับ
7865 มุมมอง

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

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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

คำตอบที่ดีที่สุด

You can follow this: https://youtu.be/XGqXEL2qQmE 

Hope it helps, Thanks

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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

Related Posts ตอบกลับ มุมมอง กิจกรรม
0
เม.ย. 23
5240
0
มิ.ย. 22
2896
dynamic domain in one2many แก้ไขแล้ว
2
พ.ค. 24
9196
0
มี.ค. 23
2126
0
เม.ย. 22
3618