[FIX] hr: use correct company for new employee
Before this commit, Creating New Employee from User's form was taking default company from the current logged-in User instead of the User for which it Employee is being created. With this commit, We take default company from User for which employee is created. closes odoo/odoo#51014 X-original-commit: 9206cc4db2a8dc5a7fbc281c1574f09bfba76544 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit is contained in:
@@ -210,5 +210,6 @@ class User(models.Model):
|
||||
self.ensure_one()
|
||||
self.env['hr.employee'].create(dict(
|
||||
name=self.name,
|
||||
company_id=self.company_id.id,
|
||||
**self.env['hr.employee']._sync_user(self)
|
||||
))
|
||||
|
||||
Reference in New Issue
Block a user