Skip to Content
Menú
This question has been flagged
3 Respostes
352 Vistes
HELLO Odoo V17, we have vendor users. Each vendor has their own clients, and they should only see their own clients' data. Currently, from the CRM module and from SALES/ORDERS/CUSTOMERS, they can see all users' clients and suppliers. How can I limit that access?   
When registering a new client in the Sales and Purchases tab, in the Salesperson field, select the assigned salesperson to restrict access. However, they can still see the contacts of other sales users.

Finally, as an example, I have 100 clients registered.

Only user 1 (should display 50 clients)
user 2 (should display 40 clients)
user 3 (should display 10 clients)
But currently, from the aforementioned modules, all users see everyone's clients. Thank you for your time and response to my question.

Avatar
Descartar
Best Answer

you’ll need to apply Record Rules on the res.partner model so each salesperson (or vendor user) can only see their own assigned clients. Go to Settings → Technical → Security → Record Rules, create a new rule for Contacts, and in the domain set [('user_id','=',user .id)]. Then assign this rule to the appropriate group (e.g., “Salesperson”). This way, when User 1 logs in they only see their 50 clients, User 2 only sees their 40, and so on, instead of viewing all contacts across the system.

Avatar
Descartar
Best Answer

Create a Record Rule


Settings → Technical → Security → Record Rules

Create a new rule like this:


Name: Customers: Restrict to Own

Object: res.partner

Domain Filter: [('|'), ('user_id','=',user.id), ('create_uid','=',user.id)]

Groups: Assign it to your vendor group or custom group (e.g., Sales / User: Own Documents Only)


Suppose you have 100 clients:

User 1 has 50 → they’ll only see their 50 (others are hidden).

User 2 has 40 → only their 40.

User 3 has 10 → only their 10.

When they go to Sales → Customers or CRM → Customers, the view will automatically filter.

Avatar
Descartar