[FIX] hr_holidays: Reset interface-based fields on leave type change
Purpose ======= When changing the leave type on a leave request, reset the technical fields that only have a visual purpose to avoid mismatch on the leave duration compute method. closes odoo/odoo#29789
This commit is contained in:
@@ -252,6 +252,12 @@ class HolidaysRequest(models.Model):
|
||||
('duration_check', "CHECK ( number_of_days >= 0 )", "If you want to change the number of days you should use the 'period' mode"),
|
||||
]
|
||||
|
||||
@api.onchange('holiday_status_id')
|
||||
def _onchange_holiday_status_id(self):
|
||||
self.request_unit_half = False
|
||||
self.request_unit_hours = False
|
||||
self.request_unit_custom = False
|
||||
|
||||
@api.onchange('request_date_from_period', 'request_hour_from', 'request_hour_to',
|
||||
'request_date_from', 'request_date_to',
|
||||
'employee_id')
|
||||
|
||||
Reference in New Issue
Block a user