跳至內容
選單
此問題已被標幟
1 回覆
4194 瀏覽次數

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

頭像
捨棄
最佳答案

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

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

頭像
捨棄
作者

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.

作者

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.

作者

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.

作者

Yes!

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

does work! Thank you very much!

Great!!!!