콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1878 화면

I made a user group that have access to a read and create operation on a Users model. But when user with that group is trying to create new user there is an error that he does not have access to write operation. 

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

Why when I'm creating something there is also necessary to have write privelage?

Access rights:

https://i.imgur.com/5iLhKeI.png

Record rules:

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

아바타
취소

If the user can create, then you give him write access as well. Because when you create a record, the write method is called too. You can check this by adding a print to write and try then to create a record.

작성자

But why write is called too? What is the point to have crate and write access splited up in that case? I want users only to create new ones and not to edit existing ones (because then they can change admin passowrd).

You could hide the admin user from the other users, overriding the search method of res.users, you can use self.env.user.id == SUPERUSER_ID then append to the domain ('id' ,'!=', self.env.user.id).

But you should verify your logic, if you create an user, you should be able to edit that user.

Sorry, the condition is if self.env.user.id != SUPERUSER_ID then append to the domain('id', '!=', SUPERUSER_ID)

작성자

But where do I put this?

And I need to protect not only one superuser but also other users with high privileges. I simply don't want users to edit others with the same or higher privileges. And the simples solution would be to deny write access but odoo is broken and calls it when it shoudn't.

관련 게시물 답글 화면 활동
2
12월 23
14965
0
10월 23
33
3
10월 23
790
1
10월 23
569
1
8월 23
2588