-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
Odoo 11 Development Cookbook - Second Edition - Second Edition
By :
In some cases, we may need more fine-grained access control, and we may also need to limit access to specific fields in a model.
It is possible for a field to be accessible only by specific security groups, using the groups attribute. We will show how to add a field with limited access to the Library Books model.
To add a field with access limited to specific security groups, perform the following steps:
private_notes = fields.Text(groups='base.group_system')
<field name="private_notes" />
That's it. Now, upgrade the addon module for the changes in the model to take place. If you sign in with a user with no system configuration access, such as demo in a database with demonstration data, the Library Books form won't display the field.
Fields with the groups attribute are specially handled to check whether the user belongs to any of the security...