diff --git a/yuthon_hr_attendance/models/duty_adjustment_schedule.py b/yuthon_hr_attendance/models/duty_adjustment_schedule.py index a27f015fd..15739fcc8 100644 --- a/yuthon_hr_attendance/models/duty_adjustment_schedule.py +++ b/yuthon_hr_attendance/models/duty_adjustment_schedule.py @@ -72,13 +72,18 @@ class DutyAdjustmentSchedule(models.Model): record.vacation_id.update_line() def revoke(self): + self.is_adjustment = False for record in self: - record.is_adjustment = False - over_record = self.env['vacation.over.line'].search([('employee_id', '=', record.employee_id.id), ('update_date', '=', record.duty_date), - ('vacation_id', '=', record.vacation_id.id), ('text', '=', '值班调休')], limit=1) + vacation_id = record.vacation_id + over_record = self.env['vacation.over.line'].search([ + ('employee_id', '=', record.employee_id.id), + ('update_date', '=', record.duty_date), + ('vacation_id', '=', record.vacation_id.id), + ('text', '=', '值班调休') + ], limit=1) if over_record: over_record.unlink() - record.vacation_id.update_line() + vacation_id.update_line() def _process_shift_days(self, current_data): """ diff --git a/yuthon_hr_attendance/models/yuthon_vacation_reports.py b/yuthon_hr_attendance/models/yuthon_vacation_reports.py index fd5e928d1..1f7f74e0d 100644 --- a/yuthon_hr_attendance/models/yuthon_vacation_reports.py +++ b/yuthon_hr_attendance/models/yuthon_vacation_reports.py @@ -1375,7 +1375,6 @@ class YuthonVacationReports(models.Model): for record in self: total = 0.0 valid_lines = record.medical_fee_ids.filtered(lambda l: not l.is_void) - for line in valid_lines: if line.update_type == 'add': total += line.lines