[FIX] hr: allow to copy employee linked to user

Before this commit, It was not possible to copy An employee which is already linked to User due `user_uniq` constraints.

Now we add `copy=False` on `user_id` field, so Employee will be copied without linked User.

closes odoo/odoo#49915

X-original-commit: 2a63df03859166414be338c6655ee8c4052666b7
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit is contained in:
Swapnesh Shah
2020-04-22 07:28:29 +00:00
parent 62c215298e
commit 7c8ae751f8
2 changed files with 11 additions and 0 deletions
+1
View File
@@ -14,3 +14,4 @@ from . import res_config_settings
from . import res_partner
from . import res_users
from . import res_company
from . import resource
+10
View File
@@ -0,0 +1,10 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
class ResourceResource(models.Model):
_inherit = "resource.resource"
user_id = fields.Many2one(copy=False)