diff --git a/yuthon_holiday/models/inherit_hr_leave.py b/yuthon_holiday/models/inherit_hr_leave.py index 001c600c6..89ef499cf 100644 --- a/yuthon_holiday/models/inherit_hr_leave.py +++ b/yuthon_holiday/models/inherit_hr_leave.py @@ -548,7 +548,6 @@ class HolidaysRequestBatch(models.Model): 'text': f"请假审批" }) ('start_time', '>=', datetime(2025, 12, 1)), - remaining_deduct = deduct_days vacation_report.vacation_report += deduct_days # 优先扣减上年剩余(补休) @@ -565,6 +564,7 @@ class HolidaysRequestBatch(models.Model): vacation_report.this_year1 -= remaining_deduct else: vacation_report.this_year1 = 0.0 + vacation_report._compute_working_overtime() domain = [ ('employee_id', '=', self.users_id.employee_ids.id), diff --git a/yuthon_hr_attendance/models/yuthon_vacation_reports.py b/yuthon_hr_attendance/models/yuthon_vacation_reports.py index 1bcdc5946..c9ab03e6a 100644 --- a/yuthon_hr_attendance/models/yuthon_vacation_reports.py +++ b/yuthon_hr_attendance/models/yuthon_vacation_reports.py @@ -542,12 +542,12 @@ class YuthonVacationReports(models.Model): for record in records: record._compute_display_date() - def update_state(self): + def update_working_overtime(self): records = self.env["yuthon.vacation.reports"].browse( self._context.get('active_ids', self._context.get('active_id', self.ids)) ) for record in records: - record.vacation_state = 'not_sent' + record._compute_working_overtime() @api.depends('vacation_date') def _compute_display_date(self): diff --git a/yuthon_hr_attendance/views/yuthon_vacation_reports_views.xml b/yuthon_hr_attendance/views/yuthon_vacation_reports_views.xml index c67f8482f..e6db0e4c9 100644 --- a/yuthon_hr_attendance/views/yuthon_vacation_reports_views.xml +++ b/yuthon_hr_attendance/views/yuthon_vacation_reports_views.xml @@ -784,12 +784,12 @@ code action = model.update_vacation() - - 还原状态 + + 一次性 code - action = model.update_state() + action = model.update_working_overtime() 更新报表