Skip to Content
Menu
This question has been flagged
2 Replies
1517 Views

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 

Avatar
Discard
Best Answer

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]]]
Avatar
Discard
Author Best Answer

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

Avatar
Discard