Odoo is the world's easiest all-in-one management software.
 It includes hundreds of business apps:
- CRM
- e-Commerce
- Contabilidad
- Inventario
- PoS
- Project
- MRP
Se marcó esta pregunta
Record Rule to allow a Manager to update all Employees record and All employee can see their own employee record
Hello Gagandeep
Please Try below Record Rules.
For Manager:-
<record id="id" model="ir.rule">
<field name="model_id" ref="model_(model_name)" />
<field name="name">for Manager</field>
<field name="domain_force">[(1,'=',1)]</field>
<field name="groups" eval="[(4,ref('base.group_user'))]"/>
</record>
For Employee:-
<record id="rule_id" model="ir.rule">
<field name="name">for Employee</field>
<field name="model_id" ref="model_(model_name)"/>
<field name="domain_force">[('employee_id.user_id','=',user.id)]</field>
<field name="groups" eval="[(4,ref('base.group_user'))]"/>
</record>
Actually I have group Employees which contain both managers and employees groups, so only one rule applied on both groups . either its show all record to all employees or only their own record(same for manager)
Hello
by using [('employee_id.user_id','=',user.id)] we can filter login user mapped employees,
by using ['|',('employee_id.user_id','=',user.id),('employee_id.parent_id.user_id','=',user.id)] we can filter child's
¿Le interesa esta conversación? ¡Participe en ella!
Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.
Inscribirse| Publicaciones relacionadas | Respuestas | Vistas | Actividad | |
|---|---|---|---|---|
| 
            
                How to compare fields in a filter ?
            
            
                    Resuelto
            
         |  | 2 ene 23  | 16437 | |
|  | 2 oct 22  | 12477 | ||
|  | 1 dic 23  | 5251 | ||
|  | 1 ene 23  | 2153 | ||
|  | 0 mar 15  | 4372 | 
