Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
1615 Widoki

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 

Awatar
Odrzuć
Najlepsza odpowiedź

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]]]
Awatar
Odrzuć
Autor Najlepsza odpowiedź

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

Awatar
Odrzuć