From 4a2b950ff9a5876b95e6170f165c93d82f459948 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= <9664676+pengyuthon@user.noreply.gitee.com> Date: Wed, 10 Sep 2025 17:37:34 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yuthon_hr_attendance/models/go_approval.py | 18 ++++++++++++++++++ yuthon_hr_attendance/models/hr_attendance.py | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/yuthon_hr_attendance/models/go_approval.py b/yuthon_hr_attendance/models/go_approval.py index 82afb328d..36a6d7596 100644 --- a/yuthon_hr_attendance/models/go_approval.py +++ b/yuthon_hr_attendance/models/go_approval.py @@ -206,12 +206,30 @@ class GoApprovals(models.Model): ]) if attendance_records: attendance_records.write({ + 'is_clock_card': True, 'is_no_card': False, 'is_early_card': False, 'is_late_card': False, 'is_abnormal': False, 'absenteeism_card': False }) + else: + current_date = start + while current_date <= end: + self.env['hr.attendance'].create({ + 'employee_id': employee.id, + date_field: current_date, + 'is_clock_card': True, + 'check_in': False, + 'check_out': False, + 'is_no_card': False, + 'is_early_card': False, + 'is_late_card': False, + 'is_abnormal': False, + 'absenteeism_card': False + }) + # 日期递增 + current_date += timedelta(days=1) diff --git a/yuthon_hr_attendance/models/hr_attendance.py b/yuthon_hr_attendance/models/hr_attendance.py index 1d50f3c85..05863070c 100644 --- a/yuthon_hr_attendance/models/hr_attendance.py +++ b/yuthon_hr_attendance/models/hr_attendance.py @@ -264,7 +264,7 @@ class HrAttendance(models.Model): # 工作日打卡情况判断 if is_workday: if employee_record: - is_no_card = not employee_record.check_in or not employee_record.check_out + is_no_card = (not employee_record.check_in or not employee_record.check_out) and not employee_record.is_clock_card else: is_no_card = True else: From 3348302ea4413ecfd17fdda38771673683289ef5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= <9664676+pengyuthon@user.noreply.gitee.com> Date: Wed, 10 Sep 2025 17:41:16 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yuthon_hr_attendance/models/hr_attendance_detail_wechat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py b/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py index ce7547aa2..0e581d754 100644 --- a/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py +++ b/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py @@ -110,7 +110,7 @@ class HrAttendanceDetail(models.Model): for resource_id in role.resource_ids: employee_list.append(resource_id.employee_id.id) if not record.employee_id.id in employee_list: - days = self.env['yuthon.vacation.reports']._create_leave_record(slot_start_dt, slot_end_dt) + days = self.env['yuthon.vacation.reports']._create_leave_record(record.employee_id,slot_start_dt, slot_end_dt) else: monthly_slots = self.env['planning.slot'].search([ ('employee_id', '=', record.employee_id.id),