From d958040137675849b39cdf30e498fcd9fbaafa23 Mon Sep 17 00:00:00 2001 From: younes Date: Tue, 15 Jul 2025 08:52:34 +0100 Subject: [PATCH] Fix bug --- .../odex_mobile/controllers/rest_api_v2/leave.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/odex25_mobile/odex_mobile/controllers/rest_api_v2/leave.py b/odex25_mobile/odex_mobile/controllers/rest_api_v2/leave.py index a8957e672..b2fb5bdc0 100644 --- a/odex25_mobile/odex_mobile/controllers/rest_api_v2/leave.py +++ b/odex25_mobile/odex_mobile/controllers/rest_api_v2/leave.py @@ -339,7 +339,8 @@ class LeaveController(http.Controller): with request.env.cr.savepoint(): holidays = http.request.env['hr.holidays'].search([('id', '=', int(id))]) if holidays: - days = holidays._get_number_of_days(body['start_date'], body['end_date'], employee) + days = holidays._get_number_of_days(body['start_date'], body['end_date'], employee.id,holidays.holiday_status_id.official_holidays, + holidays.holiday_status_id.working_days) local_tz = pytz.timezone( user.tz or 'GMT') from_date = fields.Datetime.from_string(body["start_date"]).replace(hour=0, minute=0, second=0, @@ -389,11 +390,11 @@ class LeaveController(http.Controller): 'att_holiday_ids': holidays.id, }) holidays.attach_ids = [(4, attach.id)] - holidays._onchange_employee() - holidays._onchange_date_from() - holidays._onchange_date_to() - holidays._get_end_date() - holidays._get_holiday_related_date() + holidays._onchange_employee() + holidays._onchange_date_from() + holidays._onchange_date_to() + holidays._get_end_date() + holidays._get_holiday_related_date() data = self.get_return_data(holidays, approvel) return http_helper.response(message=_("Leave Updated Successfully"), data={'leaves': [data]}) else: