[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:
Swapnesh Shah
2020-05-11 10:13:29 +00:00
committed by GitHub
parent 5faf3ce15e
commit 665c2d536f
+1
View File
@@ -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)
))