From b3ba77abf3b0be881d886332e640d8b258b92446 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: Sat, 28 Feb 2026 18:29:41 +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 --- yuthon_holiday/models/inherit_hr_leave.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/yuthon_holiday/models/inherit_hr_leave.py b/yuthon_holiday/models/inherit_hr_leave.py index 4a10e2910..d8efed83a 100644 --- a/yuthon_holiday/models/inherit_hr_leave.py +++ b/yuthon_holiday/models/inherit_hr_leave.py @@ -627,16 +627,15 @@ class HolidaysRequestBatch(models.Model): for record in overtime_records: if remaining_deduct <= 0: break - current_remaining = record.public_holidays + record.workday # 剩余数 + current_remaining = record.remaining_quantity # 剩余数 deduct_amount = min(remaining_deduct, current_remaining) if remaining_deduct < current_remaining: carry_state = 'partial' else: carry_state = 'completed' - record.write({ 'carry_forward_date': fields.Date.to_string(period_start), - 'carry_forward_quantity': deduct_amount, + 'carry_forward_quantity': record.carry_forward_quantity + deduct_amount, 'carry_forward_state': carry_state, }) remaining_deduct -= deduct_amount