Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
5106 Vistas


.py

user = fields.Many2one('res.users', string='User', default=lambda self: self.env.uid)

.xml

<field name="user"/>

return current user who created transaction

here returns ( adminstrator)

but i need the current user department

need to be adminstration dep.

how do i get it ?





Avatar
Descartar
Mejor respuesta

link it with hr.employee instead of res.users

Avatar
Descartar
Autor Mejor respuesta

thanks it helped

answer is (hr.department)

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
1
jun 24
1504
0
mar 15
4290
3
mar 15
4329
1
ago 25
3492
1
oct 24
1876