[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) <odo@openerp.com>
This commit is contained in:
Thibault Francois
2020-07-29 09:02:49 +00:00
parent 559a9cf018
commit fb396a954d
+1 -1
View File
@@ -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')