简体   繁体   English

Odoo - 使一组字段不可见

[英]Odoo - Make a field invisible for 1 group

I want to make a control invisible for users of only 1 group.我想让控件对只有 1 个组的用户不可见。 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.我知道如何做相反的事情,也就是说,将对该字段的访问限制为 1 组。 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?有没有简单的方法,最好是使用 Odoo Studio?

Thanks in advance !提前致谢 !

You can precede the group's external ID by !您可以在组的外部 ID 前面加上! , for example: , 例如:

groups="!website.group_multi_website"

The user_has_groups method (which is user to apply the groups ) will return True if the current user is a member of one of the given groups not preceded by !如果当前用户是给定组之一的成员,则user_has_groups方法(这是应用的用户!将返回True and is not member of any of the groups preceded by !并且不是!之前的任何组的成员

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM