Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
4185 Weergaven

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
Annuleer
Beste antwoord

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

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

Avatar
Annuleer
Auteur

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.

Auteur

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.

Auteur

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.

Auteur

Yes!

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

does work! Thank you very much!

Great!!!!