diff --git a/yuthon_hr_attendance/models/yuthon_vacation_reports.py b/yuthon_hr_attendance/models/yuthon_vacation_reports.py index 6f07ec5b4..4dd0dfbfb 100644 --- a/yuthon_hr_attendance/models/yuthon_vacation_reports.py +++ b/yuthon_hr_attendance/models/yuthon_vacation_reports.py @@ -422,8 +422,7 @@ class YuthonVacationReports(models.Model): def update_line(self): if self.vacation_date == fields.Date.from_string('2026-01-01'): return - # 更新育儿假 - self.employee_id.update_parental_leave() + self.manage_reject() # ========== 第一步:处理年假逻辑 ========== for rec in self: @@ -433,6 +432,11 @@ class YuthonVacationReports(models.Model): self_overtime = rec.overtime_ids.filtered(lambda o: not o.workflow_record_id and o.text == '上月额度继承') self_overtime.workday = (rec.dynamic_previous_year1 + rec.this_year1) * 8 + self_parenting = rec.parenting_line_ids.filtered(lambda o:o.text == '上月额度继承') + if not self_parenting: + # 更新育儿假 + self.employee_id.update_parental_leave() + # 如果上个月加班是0 删除明细 if self_overtime.workday == 0: self_overtime.unlink()