Odoo - Make a field invisible for 1 group

Viewed 110

I want to make a control invisible for users of only 1 group. All users of other groups have the right to access this field. I know how to do the opposite, that is to say, restrict access to the field to 1 group. But this way the list will be very long if I have to put all the groups. Is there a simple method, preferably with Odoo Studio?

Thanks in advance !

1 Answers

You can precede the group's external ID by !, for example:

groups="!website.group_multi_website"

The user_has_groups method (which is used to apply the groups) will return True if the current user is a member of one of the given groups not preceded by ! and is not member of any of the groups preceded by !

Related