[FIX] fix some bug api

This commit is contained in:
odex 2024-07-14 10:26:04 +03:00
parent 1d731161f9
commit 83331326c2
1 changed files with 3 additions and 7 deletions

View File

@ -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,
@ -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 = {