[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 <kba@odoo.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user