Problem with eval in "Read Only Depends On" for custom field

Hi, i added a custom field called “material” to the quotation item doctype because i want the item table in the quotation doctype to include this field. I want this material field to only be available for a certain item group. The simplest way i could think of was using the “Read Only” property but i have encountered some behavior that i can not explain and it is possibly a bug. When using the statement eval:doc.item_group == ‘test’ inside “Read Only Depends On” it works as expected and the material property inside the item table in the quotation doctype becomes locked aka ready only when an item with item_group= test is selected in that row. Now the Problem is that i want it to be available only for one item_group so i changed the statement to the following: eval:doc.item_group != ‘test’ . I expected the field to be read only for every item_group except test in this case, but this is not what happens, instead the material field is read only no matter what item_group the selected item belongs to.
i would greatly appreciate someone helping me :slight_smile:

Please read this comment.

Thank you for your reply, when using edit row it works but its not an acceptable solution. Iam not talking about “display depends on” but about “read only depends on” if that makes any difference. The thing is when using == as a condition it does work in list view but not with != , how can the condition affect the behavior in this case ? When i add all the item groups in one statement like this eval:doc.item_group == ‘test’ || doc.item_group == ‘test1’ || doc.item_group == ‘test2’ it works as excpected meaning that for these 3 test item groups the field cant be selected in list view but for other items groups it can be selected.