Trợ giúp

0

(solved) return employee user department

Avatar
Ahmed Badawi


.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 ?





Ảnh đại diện
Huỷ bỏ
2 Câu trả lời
0
Avatar
Hassan Al-Khursi
Best Answer

link it with hr.employee instead of res.users

Ảnh đại diện
Huỷ bỏ
0
Avatar
Ahmed Badawi
Best Answer

thanks it helped

answer is (hr.department)

Ảnh đại diện
Huỷ bỏ