From f87662e5b0b6a2ff607f85d1be53ea71155e33d7 Mon Sep 17 00:00:00 2001 From: Florian Damhaut Date: Thu, 28 Apr 2022 14:32:24 +0000 Subject: [PATCH] [FIX] hr_holidays: remove timeoff warning when unecessary Step to reproduce: - As mitchell admin - Change user's/employee tz to something != UTC - Go to time off - Click on the calendar Current behaviour: - Wizard Popup with a timezone warning - If the same thing is done with the 'New Time Off' button, the warning is not present Behaviour after PR: - No Warning - `request_unit_custom` should be False if `holiday_status_id` is set which might happen in default_values. opw-2828936 closes odoo/odoo#90357 X-original-commit: 5565eb9f3dc4259f1304373eff83f7d54a0db7be Signed-off-by: Kevin Baptiste --- addons/hr_holidays/models/hr_leave.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/hr_holidays/models/hr_leave.py b/addons/hr_holidays/models/hr_leave.py index bcd2845052d..e13de639204 100644 --- a/addons/hr_holidays/models/hr_leave.py +++ b/addons/hr_holidays/models/hr_leave.py @@ -83,6 +83,7 @@ class HolidaysRequest(models.Model): if lt: defaults['holiday_status_id'] = lt.id + defaults['request_unit_custom'] = False if 'state' in fields_list and not defaults.get('state'): lt = self.env['hr.leave.type'].browse(defaults.get('holiday_status_id'))