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 af108c8ed..be9a3d805 100644 --- a/odex25_mobile/odex_mobile/controllers/rest_api_v2/leave.py +++ b/odex25_mobile/odex_mobile/controllers/rest_api_v2/leave.py @@ -40,8 +40,8 @@ class LeaveController(http.Controller): 'type_value': hol.holiday_status_id.id, 'reason_msg': hol.reason or "", 'alternative_chick': hol.holiday_status_id.alternative_chick, - 'replacement_id': hol.replace_by.id if hol.replace_by else False, - 'replacement_name': hol.replace_by.name if hol.replace_by else False, + 'replacement_id': hol.sudo().replace_by.id if hol.replace_by else False, + 'replacement_name': hol.sudo().replace_by.name if hol.replace_by else False, 'start_date': str(hol.date_from), 'end_date': str(hol.date_to), 'attachment': self.get_attchment(hol), 'reason': hol.name, 'state': validator.get_state_name(hol, hol.state), 'state_name': hol.state, 'employee_id': hol.employee_id.id, 'employee_name': hol.employee_id.name, @@ -103,7 +103,7 @@ class LeaveController(http.Controller): holidays = http.request.env['hr.holidays'].search( [('employee_id', '=', employee.id), ('type', '=', 'remove')], offset=offset, limit=limit) count = http.request.env['hr.holidays'].search_count( - [('employee_id', '=', employee.id), ('type', '=', 'remove')], ) + [('employee_id', '=', employee.id), ('type', '=', 'remove')],) ticket_cash_type = http.request.env['hr.ticket.request.type'].search([]) ticket_cash = [] if ticket_cash_type: @@ -174,7 +174,6 @@ class LeaveController(http.Controller): data = None try: holidays = http.request.env['hr.holidays'].sudo().search([('id', '=', id)]) - print(holidays) if holidays: data = self.get_return_data(holidays) @@ -271,9 +270,6 @@ class LeaveController(http.Controller): success=False) try: holidays = http.request.env['hr.holidays'].search([('id', '=', int(id))]) - print(holidays, id) - - if holidays: days = holidays._get_number_of_days(body['start_date'], body['end_date'], employee) vals = {