Skip to Content
Menu
This question has been flagged
1 Reply
3789 Views

I have installed Contact plugin, I ucheked Contact creation for my users. Then I altered rule for Internal users so that everyone have Read and Write Access to all contacts (without Creating and Deleting). Now I want to restrict that Write rule so that users can edit only their own info.

I've tried to add rule like this:

https://i.imgur.com/qmFJyrI.png    (I can't upload photo here)

But it blocks everyone from editing. When this rule is disabled editing still works, but everyone can edit everyone.
How do I do this?

Odoo 12

Avatar
Discard
Best Answer

'user_id' refers to the "Salesman". 'id' refers to the user.

Change the rule to: [('id', '=', user.partner_id.id)]

Avatar
Discard
Author

Still does not work. This is always showing up:

https://i.imgur.com/PJhMZD0.png

See if there is another rule defined on Contacts that is conflicting with your rule.

Just noticed one more thing. The screenshot of the rule you posted earlier did not have have "Read" checked off. You should select "Read" so each user can view their own record.

Author

Here are all the the Access rights for contacts:

https://i.imgur.com/uYRmHig.png

and here all the Record rules:

https://i.imgur.com/kqOJcoM.png

My bad. The condition should be

[('id', '=', user.partner_id.id)]

I have updated my previous answer. Hope that helps.

Author

And about checking the "Read" - I want people to see all the contact but to allow them edit only theirs. But my rule does not matter. With our without everyone can see all the contacts.

Author

Yes!

[('id', '=', user.partner_id.id)]

does work! Thank you very much!

Great!!!!