[FIX] hr_timesheet: AccessError editing timesheets

Make department_id of account_analytic_line readonly, so that when the field is written it is not also propagated to the employee, which
may fail when the user has write access to timesheets but not to employees.

Fixes #14084
This commit is contained in:
Leonardo Donelli
2016-11-15 10:56:23 +01:00
committed by Denis Vermylen (dve)
parent 1c21faafb9
commit 814c2e83cc
+1 -1
View File
@@ -9,7 +9,7 @@ class AccountAnalyticLine(models.Model):
task_id = fields.Many2one('project.task', 'Task')
project_id = fields.Many2one('project.project', 'Project')
department_id = fields.Many2one('hr.department', "Department", related='user_id.employee_ids.department_id', store=True)
department_id = fields.Many2one('hr.department', "Department", related='user_id.employee_ids.department_id', store=True, readonly=True)
@api.onchange('project_id')
def onchange_project_id(self):