Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie

Hi, I'm new in Odoo14

So, I want the admin account in Settings/Users & Companies/Users to be invisible if the one that logged in is non-admin user. With the code below successfully running on a non-admin account: 


        <record id="admin_user_hidden" model="ir.rule">            

                <field name="name">Only admin can see admin userfield>     

                <field name="model_id" ref="base.model_res_users"/>      

                <field name="global" eval="2"/>            

                <field name="domain_force">[('id', '!=', 2)]field>        

                <field name="perm_read" eval="True"/>


but when I try to login with an admin account a message appears that says:


403: Forbidden

The page you were looking for could not be authorized.

Error message:

Due to security restrictions, you are not allowed to access 'Users' (res.users) records.

Records: Administrator (id=2)
User: Administrator (id=2)

This restriction is due to the following rules:
- Only admin can see admin user

Contact your administrator to request access if necessary.

Implicitly accessed through 'Users' (res.users).


So what's the problem?


Awatar
Odrzuć

did you find any solution?

Hello,

You can apply following record rule in res.users model.

[('id', '!=', admin_user_id)]

Powiązane posty Odpowiedzi Widoki Czynność
0
cze 22
2896
3
maj 24
7863
2
maj 24
9196
1
paź 22
3281
1
sty 22
11972