diff --git a/yuthon_hr_attendance/models/yuthon_vacation_reports.py b/yuthon_hr_attendance/models/yuthon_vacation_reports.py index 149be4983..20fe2fc22 100644 --- a/yuthon_hr_attendance/models/yuthon_vacation_reports.py +++ b/yuthon_hr_attendance/models/yuthon_vacation_reports.py @@ -242,10 +242,10 @@ class YuthonVacationReports(models.Model): ('employee_id', '=', rec.employee_id.id), ('vacation_date', '=', last_month) ], limit=1) - if not last_month_report: + last_remain = last_month_report.remain_missed_meals + if not last_remain: inherit_lines.sudo().unlink() else: - last_remain = last_month_report.remain_missed_meals or 0.0 inherit_lines.write({ 'update_lines': last_remain, })