From 3f07fa2eacf3899efe607fa57333aacc0087dc59 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: Thu, 23 Apr 2026 10:49:33 +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 | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/yuthon_hr_attendance/models/yuthon_vacation_reports.py b/yuthon_hr_attendance/models/yuthon_vacation_reports.py index 4ca3f374c..98cd7c1e5 100644 --- a/yuthon_hr_attendance/models/yuthon_vacation_reports.py +++ b/yuthon_hr_attendance/models/yuthon_vacation_reports.py @@ -318,6 +318,20 @@ class YuthonVacationReports(models.Model): self_meal = rec.meal_fee_ids.filtered(lambda o: not o.workflow_record_id and o.text == '上月额度继承') self_meal.update_lines = rec.remain_missed_meals + add_overtime_lines = rec.overtime_ids.filtered( + lambda o: o.text != '上月额度继承' and o.update_type == 'add' and o.is_void != True) + # 计算补休新增总天数 + workday_overtime_add = sum((line.workday or 0) for line in add_overtime_lines) / 8 + holidays_overtime_add = sum((line.public_holidays or 0) for line in add_overtime_lines) / 8 + rec.this_year1 += workday_overtime_add + holidays_overtime_add + rec.year_workday += workday_overtime_add + rec.year_holiday += holidays_overtime_add + # 计算年假新增总天数 + add_leave_lines = rec.leave_ids.filtered( + lambda o: o.text != '上月额度继承' and o.update_type == 'add' and o.is_void != True) + dynamic_remainder_year = sum((line.update_lines or 0) for line in add_leave_lines) / 8 + rec.dynamic_remainder_year += dynamic_remainder_year + valid_leave_lines = rec.leave_ids.filtered( lambda l: l.workflow_record_id and l.update_type == 'reduce' and l.is_void != True ) @@ -366,19 +380,6 @@ class YuthonVacationReports(models.Model): rec.used_this_year1 += deduct_from_current1 # 累加到本年已休 remaining_overtime_deduct -= deduct_from_current1 - add_overtime_lines = rec.overtime_ids.filtered(lambda o: o.text != '上月额度继承' and o.update_type == 'add' and o.is_void != True) - # 计算补休新增总天数 - workday_overtime_add = sum((line.workday or 0) for line in add_overtime_lines) / 8 - holidays_overtime_add = sum((line.public_holidays or 0) for line in add_overtime_lines) / 8 - rec.this_year1 += workday_overtime_add + holidays_overtime_add - rec.year_workday += workday_overtime_add - rec.year_holiday += holidays_overtime_add - # 计算年假新增总天数 - add_leave_lines = rec.leave_ids.filtered( - lambda o: o.text != '上月额度继承' and o.update_type == 'add' and o.is_void != True) - dynamic_remainder_year = sum((line.update_lines or 0) for line in add_leave_lines) / 8 - rec.dynamic_remainder_year += dynamic_remainder_year - rec._compute_leave() rec._compute_meal_fee() rec._compute_working_overtime()