From 814c2e83ccdc71d268cddc3dabfff2ce4177aa61 Mon Sep 17 00:00:00 2001 From: Leonardo Donelli Date: Mon, 31 Oct 2016 17:36:06 +0100 Subject: [PATCH] [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 --- addons/hr_timesheet/hr_timesheet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_timesheet/hr_timesheet.py b/addons/hr_timesheet/hr_timesheet.py index 14e885a40a3..2faaf91cfd6 100644 --- a/addons/hr_timesheet/hr_timesheet.py +++ b/addons/hr_timesheet/hr_timesheet.py @@ -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):