Odoo - OpenERP - How to restrict visibility of customers & contacts for sales persons to only their own?
we need to split the contact , customers for each sales person so each sales person responsible of certain customers so the other sales man shouldn't see the other sales contacts or customers
You can do that rather easily with Access Rules, similarly to what is done by default for the "See Own Leads" group.
- Create a new group for your sales persons, or modify the existing "Sales User" group if you'd like this to apply to all of them.
- In the Rules tab of the group, click Add, then choose Create at the bottom of the pop-up.
Choose a name, then choose "Partner" as the object, then carefully copy/paste the following in the Rule Definition box:
- To test: login as a Sales User, who is not the Administrator (Access Rules do not apply for the Administrator)
Note: You need to enable the Technical Features access right for the administrator in order to perform these changes.
After setting the rule in Partner Object to ['|',('user_id','=',user.id),('user_id','=',False)], indeed a user cannot access anymore to the customers list of the other users.
The suggested rule ['|',('user_id','=',user.id),('user_id','=',False)] restricts the user to see only contacts they are set as salesperson or contacts that have no salesperson. I prefer to restrict it to who created the user. to do that, replace the rule with [('create_uid','=',user.id)]
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!