Skip to Content
Menu
This question has been flagged
2 Replies
5282 Views


.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
Discard
Best Answer

link it with hr.employee instead of res.users

Avatar
Discard
Author Best Answer

thanks it helped

answer is (hr.department)

Avatar
Discard
Related Posts Replies Views Activity
1
Jun 24
1810
0
Mar 15
4538
3
Mar 15
4549
1
Aug 25
3838
1
Oct 24
5291