From ead794825ed9a59f7b26ddd3690f50daf747ba56 Mon Sep 17 00:00:00 2001 From: Philippe Wauthy Date: Fri, 22 Apr 2022 11:29:32 +0000 Subject: [PATCH] [IMP] hr_holidays: set default time off type based on sequence In hr_holidays, when creating a time off, set the default time off type based on the sequence of the time off type task-2832674 closes odoo/odoo#89623 Signed-off-by: Kevin Baptiste --- addons/hr_holidays/models/hr_leave.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_holidays/models/hr_leave.py b/addons/hr_holidays/models/hr_leave.py index 315c5ed8b10..bcd2845052d 100644 --- a/addons/hr_holidays/models/hr_leave.py +++ b/addons/hr_holidays/models/hr_leave.py @@ -79,7 +79,7 @@ class HolidaysRequest(models.Model): defaults = self._default_get_request_parameters(defaults) if 'holiday_status_id' in fields_list and not defaults.get('holiday_status_id'): - lt = self.env['hr.leave.type'].search(['|', ('requires_allocation', '=', 'no'), ('has_valid_allocation', '=', True)], limit=1) + lt = self.env['hr.leave.type'].search(['|', ('requires_allocation', '=', 'no'), ('has_valid_allocation', '=', True)], limit=1, order='sequence') if lt: defaults['holiday_status_id'] = lt.id