Merge remote-tracking branch 'source_origin/dev_odex25_hr' into dev_odex25_hr
This commit is contained in:
commit
75f6aa7d71
|
|
@ -486,6 +486,8 @@ class Attendance(models.Model):
|
||||||
for record in self:
|
for record in self:
|
||||||
record.attendance_duration = 0.0
|
record.attendance_duration = 0.0
|
||||||
record.attendance_duration_hhmmss = "00:00:00"
|
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:
|
if not record.employee_id or not record.action_date:
|
||||||
continue
|
continue
|
||||||
|
|
|
||||||
|
|
@ -576,14 +576,14 @@ class HRHolidays(models.Model):
|
||||||
def process_holidays_scheduler_queue(self):
|
def process_holidays_scheduler_queue(self):
|
||||||
current_date_run = (datetime.utcnow() + timedelta(hours=3)).date()
|
current_date_run = (datetime.utcnow() + timedelta(hours=3)).date()
|
||||||
employees = self.env['hr.employee'].search(
|
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(
|
).filtered(
|
||||||
lambda emp: emp.first_hiring_date
|
lambda emp: emp.first_hiring_date
|
||||||
and emp.first_hiring_date <= current_date_run
|
and emp.first_hiring_date <= current_date_run
|
||||||
and emp.contract_id
|
and emp.contract_id
|
||||||
and emp.contract_id.emp_type in ('other', 'saudi', 'displaced', 'external', 'external2')
|
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))
|
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:
|
for emp in employees:
|
||||||
already_exist = None
|
already_exist = None
|
||||||
current_date = (datetime.utcnow() + timedelta(hours=3)).date()
|
current_date = (datetime.utcnow() + timedelta(hours=3)).date()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue