Merge pull request #6228 from expsa/handle_multi_compnay_in_holiday_schedular

[IMP] hr_holidays_public: handle_multi_compnay_in_holiday_schedular
This commit is contained in:
abdurrahman-saber 2026-01-18 19:19:11 +02:00 committed by GitHub
commit 927c2f4e86
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -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()