Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
11617 Lượt xem

Hi,

    I want to setup user management in such a way that a user given access to "Records Created By Me Only" group, has access only to create new users, and read, edit and delete only those particular users. So I created a record rule for this group for the Users table, with domain `[('create_uid','=',user.id)], with checks for Apply for Read, Write and Delete (not for create). 


    But now, When logging in as the new user, I am not able to see all the users in the system ( which is the expected behaviour). But when I click on create, I get the following error: The requested operation cannot be completed due to security restrictions. Please contact your system administrator.

(Document type: res.users, Operation: read). 


   Please suggest on how I can achieve this.

Ảnh đại diện
Huỷ bỏ
Tác giả

@travis Sorry I am not able to comment in your answer. I tried that too. But still getting the same error

Câu trả lời hay nhất

I think it may be because there is no user assigned yet, so Odoo is evaluating your Record Rule to say: "The logged in user is not the same as no user, so I won't let you read this."


I suggest updating your record rule to allow for create_uid = False like below:

['|',('create_uid','=',False),('create_uid','=',user.id)]


This will allow users to work with any records belonging to them or records who don't belong to anyone yet (new records before they are saved).


Source for idea: http://stackoverflow.com/a/16458039/3330552

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 9 20
5391
1
thg 11 21
2684
0
thg 7 24
3
1
thg 12 21
9912
1
thg 9 21
2797