From 7cd7ba2a7477f320a90303f4e68eb10ba543af18 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 19:37:21 +0800 Subject: [PATCH] =?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 --- .../models/yuthon_vacation_reports.py | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/yuthon_hr_attendance/models/yuthon_vacation_reports.py b/yuthon_hr_attendance/models/yuthon_vacation_reports.py index 47819ac68..d338d0aa0 100644 --- a/yuthon_hr_attendance/models/yuthon_vacation_reports.py +++ b/yuthon_hr_attendance/models/yuthon_vacation_reports.py @@ -502,22 +502,26 @@ class YuthonVacationReports(models.Model): 'overtime_ids.legal_day', 'overtime_ids.public_holidays', 'overtime_ids.update_type', - 'overtime_ids.is_void' + 'overtime_ids.is_void', 'overtime_ids.workflow_record_id' ) def _compute_working_overtime(self): for record in self: - total_add = 0.0 total_add1 = 0.0 + total_add = 0.0 + for line in record.overtime_ids: - if not line.is_void: - line_total = (line.workday or 0) + (line.legal_day or 0) + (line.public_holidays or 0) - if line.update_type == 'add' and line.workflow_record_id: - total_add += line_total - else: - total_add += line_total - record.working_overtime = max(total_add / 8, 0) - record.done_working_overtime = total_add1 / 8 + if line.is_void: + continue + + line_total = (line.workday or 0) + (line.legal_day or 0) + (line.public_holidays or 0) + total_add += line_total + + if line.workflow_record_id and line.update_type == 'add': + total_add1 += line_total + + record.working_overtime = max(total_add / 8, 0) # 所有有效明细行总额 + record.done_working_overtime = total_add1 / 8 # 符合条件的明细行总额 record.cop_leave = total_add1 / 8 @api.depends('meal_fee_ids.update_lines', 'meal_fee_ids.update_type', 'meal_fee_ids.is_void')