添加功能

This commit is contained in:
zhou
2025-08-27 14:56:37 +08:00
parent 7795ee74af
commit e9e97c8acb
+5 -2
View File
@@ -169,17 +169,18 @@ class HrAttendance(models.Model):
#考勤异常提醒
def attendance_abnormal_remind(self):
menu_id = self.env['ir.ui.menu'].search([('name', '=', '我的异常')])
all_employees = self.env['hr.employee'].search([])
current_date = fields.Date.today()
month_start = current_date.replace(day=1)
month_end = (month_start + relativedelta(months=1) - relativedelta(days=1))
current_time = fields.Datetime.now()
for employee in all_employees:
domain = [
('shift_name', '=', '行政班次'),
('employee_id', '=', employee.id),
('current_data', '>=', month_start),
('current_data', '<=', month_end)
('current_data', '<=', month_end),
('employee_id.name', '=', '叶华锋')
]
is_no_card = 0
is_early_card = 0
@@ -207,6 +208,8 @@ class HrAttendance(models.Model):
description="本月迟到: {}\n本月缺卡: {}\n本月早退: {}\n本月异常:{}\n 本月旷工: {}\n"
.format(is_late_card, is_no_card, is_early_card, is_abnormal, absenteeism_card),
url=url, btntxt="详细信息")
logging.info(f"执行时间为{current_time}")
logging.info(f"打卡异常提醒发送成功,员工:{employee.name},本月迟到: {is_late_card},本月缺卡: {is_no_card},本月早退: {is_early_card},本月异常:{is_abnormal},本月旷工: {absenteeism_card}")
def missing_card_judgment(self):