diff --git a/yuthon_hr_attendance/models/yuthon_vacation_reports.py b/yuthon_hr_attendance/models/yuthon_vacation_reports.py index bea4dd5bb..4554c4f2d 100644 --- a/yuthon_hr_attendance/models/yuthon_vacation_reports.py +++ b/yuthon_hr_attendance/models/yuthon_vacation_reports.py @@ -132,38 +132,7 @@ class YuthonVacationReports(models.Model): def confirm_state(self): for rec in self: - rec.vacation_state = 'confirmed' - # 计算下个月的日期(基于当前记录的vacation_date) - current_date = rec.vacation_date - if current_date.month == 12: - next_month_date = current_date.replace(year=current_date.year + 1, month=1, day=1) - else: - next_month_date = current_date.replace(month=current_date.month + 1, day=1) - # 查找下个月是否已有该员工的记录 - next_month_record = self.search([ - ('employee_id', '=', rec.employee_id.id), - ('vacation_date', '=', next_month_date) - ], limit=1) - - inherit_vals = { - 'leave': rec.leave, - 'working_overtime': rec.working_overtime, - 'medical_fee': rec.medical_fee, - } - if next_month_record: - # 如果下个月记录已存在,更新继承字段 - next_month_record.write(inherit_vals) - - # 处理年假明细行继承 - if rec.leave: - leave_hours = rec.leave * 8 - self._update_leave_lines(next_month_record, [rec], leave_hours) - - # 处理补休明细行继承 - if rec.working_overtime: - overtime_hours = rec.working_overtime * 8 - self._update_over_lines(next_month_record, [rec], overtime_hours) - + rec.manage_reject() @api.depends('vacation_date') def _compute_display_date(self): diff --git a/yuthon_property_approval/views/inherit_yuthon_property_views.xml b/yuthon_property_approval/views/inherit_yuthon_property_views.xml index 48c802a89..e119c8238 100644 --- a/yuthon_property_approval/views/inherit_yuthon_property_views.xml +++ b/yuthon_property_approval/views/inherit_yuthon_property_views.xml @@ -396,7 +396,8 @@