From fb396a954dcd3fb29db7b45d1aa12c60561fc831 Mon Sep 17 00:00:00 2001 From: Thibault Francois Date: Tue, 28 Jul 2020 12:51:43 +0000 Subject: [PATCH] [FIX] hr_timesheet: Timesheet in multi company Allow user that have a employee in a company A and that is allowed on company A and B to timesheet on company B Problem: A user have access on company A and B but is link to an employee that belong to company A. He want to timesheet on a project from the company B. He gets an error "Incompatible companies on records". Since most users are linked to only one employee that belongs to one company. It's impossible to have consistent companies. Solution: The employee shouldn't be checked on the timesheet closes odoo/odoo#55074 X-original-commit: 7eada96b8fc1c370801ff42231167885cc8e46bc Signed-off-by: Olivier Dony (odo) --- addons/hr_timesheet/models/hr_timesheet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_timesheet/models/hr_timesheet.py b/addons/hr_timesheet/models/hr_timesheet.py index 69ed16ed4b2..50fd2bce355 100644 --- a/addons/hr_timesheet/models/hr_timesheet.py +++ b/addons/hr_timesheet/models/hr_timesheet.py @@ -45,7 +45,7 @@ class AccountAnalyticLine(models.Model): 'project.project', 'Project', compute='_compute_project_task_id', store=True, readonly=False, domain=_domain_project_id) user_id = fields.Many2one(compute='_compute_user_id', store=True, readonly=False) - employee_id = fields.Many2one('hr.employee', "Employee", check_company=True, domain=_domain_employee_id) + employee_id = fields.Many2one('hr.employee', "Employee", domain=_domain_employee_id) department_id = fields.Many2one('hr.department', "Department", compute='_compute_department_id', store=True, compute_sudo=True) encoding_uom_id = fields.Many2one('uom.uom', compute='_compute_encoding_uom_id')