[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, ...)
This commit is contained in:
Yannick Tivisse
2019-09-05 07:34:33 +00:00
parent 2df9d021e1
commit d1d4364320
@@ -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([