From d1d4364320c5dfaf1a3c7d4f84f9a54e12c4b3b4 Mon Sep 17 00:00:00 2001 From: Yannick Tivisse Date: Tue, 3 Sep 2019 10:06:26 +0000 Subject: [PATCH] [FIX] hr_holidays: Only allow time off users to be time off type responsible This could responsibility is designed for that kind of users. Without that it could lead to inconsistencies during the time off validation flow. (ir.rule errors, ...) --- addons/hr_holidays/models/hr_leave_type.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/hr_holidays/models/hr_leave_type.py b/addons/hr_holidays/models/hr_leave_type.py index 46ac9886973..3695fb36ce0 100644 --- a/addons/hr_holidays/models/hr_leave_type.py +++ b/addons/hr_holidays/models/hr_leave_type.py @@ -69,6 +69,7 @@ class HolidaysType(models.Model): compute='_compute_group_days_leave', string='Group Time Off') company_id = fields.Many2one('res.company', string='Company', default=lambda self: self.env.company) responsible_id = fields.Many2one('res.users', 'Responsible', + domain=lambda self: [('groups_id', 'in', self.env.ref('hr_holidays.group_hr_holidays_user').id)], help="This user will be responsible for approving this type of times off" "This is only used when validation is 'hr' or 'both'",) validation_type = fields.Selection([