Hi everyone,
I’m setting up my first ERP with Odoo and I’ve run into a problem with salespeople access rights. What I want is that each salesperson can only see their own customers (the ones assigned to them).
I created a record rule in
Settings > Technical > Security > Record Rules with the following setup:
Model: Contacts (res.partner)
Domain:
['|', ('user_id', '=', user.id), ('user_id', '=', False)]
Groups: Sales / Salespeople
So far this seems to work, because salespeople only see their own customers.
The problem comes after that:
When a salesperson tries to log in, Odoo shows:
403: Forbidden You are not authorized to access this page.
If the user logs in without being a salesperson and later the group is assigned, when they open a customer, create a quotation, etc., Odoo shows:
Access Error does not have 'read' access to: - Contact (res.partner)
It looks like the record rule is blocking something that Odoo needs internally, but I’m not sure what I’m missing or how this should be configured properly.
Could someone point me in the right direction on how to restrict customers per salesperson without breaking system access?
Thanks in advance! 🙏