diff --git a/odex25_hr/attendances/models/hr_attendance.py b/odex25_hr/attendances/models/hr_attendance.py index 67ef97254..50056a741 100644 --- a/odex25_hr/attendances/models/hr_attendance.py +++ b/odex25_hr/attendances/models/hr_attendance.py @@ -486,6 +486,8 @@ class Attendance(models.Model): for record in self: record.attendance_duration = 0.0 record.attendance_duration_hhmmss = "00:00:00" + record.mission_duration = 0.0 + record.permission_duration = 0.0 if not record.employee_id or not record.action_date: continue 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()