From 4d7b4a6acfa9ba6d22820bab69773e5330979f51 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:30:11 +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 | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/yuthon_hr_attendance/models/yuthon_vacation_reports.py b/yuthon_hr_attendance/models/yuthon_vacation_reports.py index 43c368d5c..47819ac68 100644 --- a/yuthon_hr_attendance/models/yuthon_vacation_reports.py +++ b/yuthon_hr_attendance/models/yuthon_vacation_reports.py @@ -503,24 +503,22 @@ class YuthonVacationReports(models.Model): 'overtime_ids.public_holidays', 'overtime_ids.update_type', 'overtime_ids.is_void' + 'overtime_ids.workflow_record_id' ) def _compute_working_overtime(self): for record in self: total_add = 0.0 - total_reduce = 0.0 - done_working_overtime = 0.0 + total_add1 = 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': + if line.update_type == 'add' and line.workflow_record_id: + total_add += line_total + else: total_add += line_total - total_reduce += line_total - elif line.update_type == 'reduce': - total_add -= line_total - done_working_overtime += line_total record.working_overtime = max(total_add / 8, 0) - record.done_working_overtime = done_working_overtime / 8 - record.cop_leave = total_reduce / 8 + 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') def _compute_meal_fee(self):