From 5a39532295ca74e4cea20653bcf0208e644307e8 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: Sun, 19 Apr 2026 16:58:14 +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 | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/yuthon_hr_attendance/models/yuthon_vacation_reports.py b/yuthon_hr_attendance/models/yuthon_vacation_reports.py index a204df6a3..22ea13aca 100644 --- a/yuthon_hr_attendance/models/yuthon_vacation_reports.py +++ b/yuthon_hr_attendance/models/yuthon_vacation_reports.py @@ -2643,6 +2643,19 @@ class VacationOverline(models.Model): } def open_overtime_carryover(self): + carryover_ids = self.env['overtime.carryover'].search([ + ('over_line_id', '=', self.id), + ('is_void', '=', False), + ], order='carry_forward_date asc') + if carryover_ids: + total_balance = self.duration + current_remaining = total_balance + for carry in carryover_ids: + carry.sudo().write({ + 'last_month': current_remaining, + 'this_month': current_remaining - carry.carry_forward_quantity, + }) + current_remaining = carry.this_month return { "type": "ir.actions.act_window", "name": "结转明细",