This commit is contained in:
younes 2025-07-15 08:52:34 +01:00
parent e20d4d3fe2
commit d958040137
1 changed files with 7 additions and 6 deletions

View File

@ -339,7 +339,8 @@ class LeaveController(http.Controller):
with request.env.cr.savepoint(): with request.env.cr.savepoint():
holidays = http.request.env['hr.holidays'].search([('id', '=', int(id))]) holidays = http.request.env['hr.holidays'].search([('id', '=', int(id))])
if holidays: 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( local_tz = pytz.timezone(
user.tz or 'GMT') user.tz or 'GMT')
from_date = fields.Datetime.from_string(body["start_date"]).replace(hour=0, minute=0, second=0, from_date = fields.Datetime.from_string(body["start_date"]).replace(hour=0, minute=0, second=0,