From 319ff9dd1c80f35108e9ae1aeae864366056750b 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: Tue, 31 Mar 2026 10:15:52 +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/overtime_approval.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yuthon_hr_attendance/models/overtime_approval.py b/yuthon_hr_attendance/models/overtime_approval.py index 6da57e0ba..154e2f170 100644 --- a/yuthon_hr_attendance/models/overtime_approval.py +++ b/yuthon_hr_attendance/models/overtime_approval.py @@ -259,10 +259,10 @@ class OvertimeApprovals(models.Model): if actual_start < base_start: total_overtime_seconds += (base_start - actual_start).total_seconds() if actual_end > base_end: - total_overtime_seconds += (actual_end - base_end).total_seconds() + real_overtime_start = max(base_end, actual_start) + total_overtime_seconds += (actual_end - real_overtime_start).total_seconds() else: total_overtime_seconds = (actual_end - actual_start).total_seconds() - original_hours = total_overtime_seconds / 3600 # 加班起步一小时 if original_hours < 1.0: From 4f6f1bf129582f9c801680739e3599ec66800071 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: Tue, 31 Mar 2026 10:24:23 +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.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/yuthon_hr_attendance/models/hr_attendance.py b/yuthon_hr_attendance/models/hr_attendance.py index fdcce548d..284304abf 100644 --- a/yuthon_hr_attendance/models/hr_attendance.py +++ b/yuthon_hr_attendance/models/hr_attendance.py @@ -1298,7 +1298,9 @@ class HrAttendance(models.Model): pass #todo 待过 def update_attendance(self, employee, current_date): - current_date_str = fields.Date.to_string(current_date) + if self.workflow_id: + if self.workflow_id.res_model == 'card.approval': + return current_date_start = datetime.combine(current_date, datetime.min.time()) # 当天 00:00:00 datetime类型 current_date_end = datetime.combine(current_date, datetime.max.time()) # 当天 23:59:59 datetime类型 @@ -1336,7 +1338,6 @@ class HrAttendance(models.Model): ('work_end', '=', True), ] go_approval_records = self.env['go.approval'].search(go_approval_domain) - match_record = False for go in go_approval_records: # 按天匹配