diff --git a/yuthon_hr_attendance/models/yuthon_vacation_reports.py b/yuthon_hr_attendance/models/yuthon_vacation_reports.py index 0646aed0d..231ef9187 100644 --- a/yuthon_hr_attendance/models/yuthon_vacation_reports.py +++ b/yuthon_hr_attendance/models/yuthon_vacation_reports.py @@ -113,7 +113,7 @@ class YuthonVacationReports(models.Model): default='not_sent') @api.depends('vacation_date', 'employee_id') - def _compute_number_card(self): + def compute_number_card(self): for record in self: count = 0 if not record.employee_id or not record.vacation_date: @@ -2137,14 +2137,16 @@ class VacationOverline(models.Model): res_model = rec.workflow_record_id.res_model res_id = rec.workflow_record_id.res_id if res_model and res_id and res_model in self.env: - overtime_id = rec.env[res_model].search([('id', '=', res_id)], limit=1) - if overtime_id: - rec.reason_application = overtime_id.reason_application - rec.overtime_name = overtime_id.name or '' - rec.start_time = overtime_id.start_time or '' - rec.end_time = overtime_id.end_time or '' - rec.duration = overtime_id.duration or 0 - rec.workflow_id = rec.workflow_record_id.workflow_id.id or False + if res_model == 'overtime.approval': + overtime_id = rec.env[res_model].search([('id', '=', res_id)], limit=1) + if overtime_id: + rec.meal = overtime_id.meal + rec.reason_application = overtime_id.reason_application + rec.overtime_name = overtime_id.name or '' + rec.start_time = overtime_id.start_time or '' + rec.end_time = overtime_id.end_time or '' + rec.duration = overtime_id.duration or 0 + rec.workflow_id = rec.workflow_record_id.workflow_id.id or False def action_void(self): self.is_void = True