From 895c5b3fa727a88368458701059b6c413b6e8cfc Mon Sep 17 00:00:00 2001 From: Abdurrahman Saber Date: Sun, 18 Jan 2026 19:18:30 +0200 Subject: [PATCH] [IMP] hr_holidays_public: handle_multi_compnay_in_holiday_schedular --- odex25_hr/hr_holidays_public/models/hr_holidays.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/odex25_hr/hr_holidays_public/models/hr_holidays.py b/odex25_hr/hr_holidays_public/models/hr_holidays.py index 3d14f5a02..d2ab242d3 100644 --- a/odex25_hr/hr_holidays_public/models/hr_holidays.py +++ b/odex25_hr/hr_holidays_public/models/hr_holidays.py @@ -576,14 +576,14 @@ class HRHolidays(models.Model): def process_holidays_scheduler_queue(self): current_date_run = (datetime.utcnow() + timedelta(hours=3)).date() employees = self.env['hr.employee'].search( - [('state', '=', 'open'), ('company_id', '=', self.env.user.company_id.id)] + [('state', '=', 'open'), ('company_id', '=', self.env.company.id)] ).filtered( lambda emp: emp.first_hiring_date and emp.first_hiring_date <= current_date_run and emp.contract_id and emp.contract_id.emp_type in ('other', 'saudi', 'displaced', 'external', 'external2') and (not emp.contract_id.date_end or emp.contract_id.date_end and emp.contract_id.date_end >= current_date_run)) - holiday_status = self.env['hr.holidays.status'].search([('company_id', '=', self.env.user.company_id.id)]) + holiday_status = self.env['hr.holidays.status'].search([('company_id', '=', self.env.company.id)]) for emp in employees: already_exist = None current_date = (datetime.utcnow() + timedelta(hours=3)).date()