Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
5935 Vizualizări

Hello,

I'm working on "Employee Directory" module (ODOO 11) and i want to create a security group that allow users among this group to see all theirs information but they can see only some information of the others employees.

Thank you a lot, in advance, for any help.

 

Imagine profil
Abandonează
Cel mai bun răspuns

Hi,

if you want to restrict the group of users to see the other employee records, ie limit the user to see only his record, you can use record rules.

<record id="hr_personal_rule" model="ir.rule">
<field name="name">Employee</field>
<field ref="hr.model_hr_employee" name="model_id"/>
<field name="domain_force">[('user_id','=',user.id)]</field>
<field name="groups" eval="[(4, ref('your_group_name'))]"/>
</record>

If you want to show some fields in employee records to only a particular group of users, you can use the group attribute along with that field.

<field name="location_id" groups="your_group_name"/>

Then this field will be only visible for the users in this group.

Thanks

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
2
iun. 22
3022
1
nov. 19
7508
3
nov. 18
7391
5
aug. 18
4372
2
apr. 17
15504