This question has been flagged
1 Reply
1722 Views

In my ticketing system based on the OCA helpdesk_mgmt module, I am trying to restrict specifics internal users to only see their own clients in contacts.

  1. To assign a salesperson, I go to the Sales & Purchase tab on the customer's Contact page, and fill in the Salesperson field.

  2. Then, I created a user group called Administration / Salesperson Contacts where I added the users I want to restrict, and created the salesperson.contacts rule that contains ['|',('user_id', '=', user.id),('user_ids','=',user.id)] and applied it to the Administration / Salesperson Contacts group.

  3. Additionally, I created a user group called Administration / All Contacts and added all my other users to it and applied the res.partner.rule.private.employee rule to it.

  4.  I removed User Type / Internal User from the res.partner.rule.private.employee rule so that my specific users are not affected by the rule.


With this configuration, my specific users have access to their contacts, but when creating a ticket and trying to validate it, I get the following error message:


Due to security restrictions, you are not allowed to create 'Contact' (res.partner) records.

Records: xxxxx (id=31)
User: Specific_User (id=11)

This restriction is due to the following rules:

res.partner.rule.private.group
salesperson.contacts
Contact your administrator to request access if necessary.


I understand that I need to modify the salesperson.contacts rule, which seems to be too restrictive, or maybe there may be other Record Rules, depending upon what I have installed but I don't know how and what. Do you have any ideas?"

Avatar
Discard
Author Best Answer
Solved: My salesperson.contacts rule was enforced for read, write, create, and delete, that's what was causing the error. By leaving only read access I solved the error.
I also took my restricted user out of the res.partner.rule.private.group group.


Avatar
Discard