!9094 添加功能

Merge pull request !9094 from 李鹏宇/dev_zhou
This commit is contained in:
李鹏宇
2026-02-28 10:31:46 +00:00
committed by Gitee
+2 -3
View File
@@ -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