diff --git a/odex25_mobile/odex_mobile/controllers/rest_api_v2/leave.py b/odex25_mobile/odex_mobile/controllers/rest_api_v2/leave.py index 6b93be29c..0db98c1e4 100644 --- a/odex25_mobile/odex_mobile/controllers/rest_api_v2/leave.py +++ b/odex25_mobile/odex_mobile/controllers/rest_api_v2/leave.py @@ -120,11 +120,14 @@ class LeaveController(http.Controller): hol_type = [] if status: for s in status: - records = balance.filtered( - lambda r: r.holiday_status_id == s) - value = {'id': s.id, 'name': s.name or "", 'ticket': s.issuing_ticket, - 'balance': records[0].remaining_leaves if records else 0, - 'alternative_chick': s.alternative_chick} + records = balance.filtered(lambda r: r.holiday_status_id == s) + value = { + "id": s.id, + "name": s.with_context({"employee_id": employee.id}).name_get()[0][1] or "", + "ticket": s.issuing_ticket, + "balance": records[0].remaining_leaves if records else 0, + "alternative_chick": s.alternative_chick, + } hol_type.append(value) li = [] if balance: @@ -386,4 +389,4 @@ class LeaveController(http.Controller): http.request._cr.rollback() _logger.error(str(e)) message = validator.get_server_error(e, user) - return http_helper.errcode(code=403, message=message) \ No newline at end of file + return http_helper.errcode(code=403, message=message)