This commit is contained in:
李鹏宇
2026-03-31 10:26:39 +08:00
2 changed files with 5 additions and 4 deletions
+3 -2
View File
@@ -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:
# 按天匹配
@@ -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: