"This content is tested in 9.0 Enterprise Edition"
In Odoo's CRM use process, we sometimes hope that multiple sales teams are not visible to each other, the system by default only to view their own permissions and view all the permissions two options.
We have two objects to deal with, one is Crm.team and the other is res.users. Let's take crm.team as an example of how to restrict access to crm.team objects.
We created 2 team members named a team and B Team,a team TL is a1,b team TL is B1, member B2.
Create a record rule, the object is Crm.team, the rule is defined as follows:
[('member_ids','in', [user.id])]
Member_ids is a field of crm.team, which means that if the current user is affiliated with the team, you can read and write additions and deletions, and set the record rule to view your own thread group.
The effect is as follows:
Both B1 and B2 can only see Team B.
The second step is to set a similar record rule to res.users, restricting it to only read members of the team, as follows:
In this way, we have achieved the beginning of the purpose of the first without the premise of two open.
Record rules for sales teams to divide permissions by team