From 61ef6284fde9761128369d6bc1a5b3487798f280 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: Fri, 8 May 2026 15:06:23 +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 | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/yuthon_hr_attendance/models/yuthon_vacation_reports.py b/yuthon_hr_attendance/models/yuthon_vacation_reports.py index 9fffa389d..234bc56a7 100644 --- a/yuthon_hr_attendance/models/yuthon_vacation_reports.py +++ b/yuthon_hr_attendance/models/yuthon_vacation_reports.py @@ -1981,15 +1981,18 @@ class YuthonVacationReports(models.Model): ('text', '=', '上月额度继承'), ], limit=1) if existing_line: - continue - self.env['vacation.parenting.line'].sudo().create({ - 'vacation_id': report.id, - 'employee_id': report.employee_id.id, - 'update_date': update_date, - 'end_date': end_date, - 'lines': number_of_hours_display, - 'text': f"上月额度继承", - }) + existing_line.write({ + 'lines': number_of_hours_display, + }) + else: + self.env['vacation.parenting.line'].sudo().create({ + 'vacation_id': report.id, + 'employee_id': report.employee_id.id, + 'update_date': update_date, + 'end_date': end_date, + 'lines': number_of_hours_display, + 'text': f"上月额度继承", + }) def _update_meal_lines(self, report, allocations, number_of_hours_display): for alloc in allocations: