1
This commit is contained in:
@@ -71,12 +71,19 @@ class HrAttendance(models.Model):
|
||||
start_date1 = fields.Date.today() - timedelta(days=7)
|
||||
start_date3 = fields.Date.today() - timedelta(days=5)
|
||||
start_date5 = fields.Date.today() - timedelta(days=3)
|
||||
|
||||
start_date6 = fields.Date.today() - timedelta(days=2)
|
||||
start_date66 = fields.Date.today() - timedelta(days=6)
|
||||
start_date7 = fields.Date.today() - timedelta(days=1)
|
||||
# 补充假期橙色逻辑
|
||||
for emp in employee_ids:
|
||||
test1 = att_ids.search([('current_data', '=', self_date_time), ('employee_id', '=', emp.id)])
|
||||
test2 = att_ids.search([('current_data', '=', start_date1), ('employee_id', '=', emp.id)])
|
||||
test3 = att_ids.search([('current_data', '=', start_date3), ('employee_id', '=', emp.id)])
|
||||
test4 = att_ids.search([('current_data', '=', start_date5), ('employee_id', '=', emp.id)])
|
||||
test5 = att_ids.search([('current_data', '=', start_date6), ('employee_id', '=', emp.id)])
|
||||
test6 = att_ids.search([('current_data', '=', start_date7), ('employee_id', '=', emp.id)])
|
||||
test7 = att_ids.search([('current_data', '=', start_date66), ('employee_id', '=', emp.id)])
|
||||
if not test1:
|
||||
att_ids.create({
|
||||
'employee_id': emp.id,
|
||||
@@ -97,6 +104,25 @@ class HrAttendance(models.Model):
|
||||
'employee_id': emp.id,
|
||||
'current_data': start_date5,
|
||||
})
|
||||
if emp.company_id.name == '集团本部':
|
||||
test5.write({
|
||||
'absenteeism_card': False,
|
||||
'is_no_card': False,
|
||||
'is_abnormal': False,
|
||||
'is_warning': False,
|
||||
})
|
||||
test6.write({
|
||||
'absenteeism_card': False,
|
||||
'is_no_card': False,
|
||||
'is_abnormal': False,
|
||||
'is_warning': False,
|
||||
})
|
||||
test7.write({
|
||||
'absenteeism_card': False,
|
||||
'is_no_card': False,
|
||||
'is_abnormal': False,
|
||||
'is_warning': False,
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user