Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
4200 Visualizzazioni

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
Abbandona
Risposta migliore

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

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

Avatar
Abbandona
Autore

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.

Autore

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.

Autore

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.

Autore

Yes!

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

does work! Thank you very much!

Great!!!!