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: