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

Hello,

I am using Studio.

I try to make a field read only based on values in tag (many2many_tags)

Example : field website must be read only if tag (category_id) = "Coopérateur"

on website field : 

[["category_id","=","Coopérateur"]] : does not work

[["category_id.name","in",["Coopérateur"]]] : gives this error :  Invalid composed field category_id.name in attrs ({"readonly": [["category_id.name","in",["Coopérateur"]]]})

Please help !

Thanks 

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

You can use the id of the tag rather than the name, so you need to get the " Coopérateur" tag id from Odoo by opening the tag and then you will see the id in url. 



Then use the tag id in the domain as below:


[["category_id","in",[1]]]
อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

Great ! That's what i was looking for. Thanks

อวตาร
ละทิ้ง