There is an issue with attachments not being correctly uploaded in the leave portal. The file moves to the bin, whether I convert it or not, and the result remains the same. code is
@http.route('/request', type='json', auth='user', methods=['POST'], website=True, csrf=False)
def submit(self, leave_reason, leave_type_select_name, date_from, date_to, duration, half_day, description, request_unit_half_name, exit_entry_check, attachment_id):
leave_type_id = request.env['hr.leave.type'].sudo().search([('name', '=', leave_type_select_name),('state','=','Approved')])
leave_type = employee.id,
'holiday_status_id': leave_type,
'date_from': date_from,
'date_to': date_to,
'number_of_days': duration,
'request_unit_half': half_day,
'request_date_from_period': request_unit_half_name,
'name': description,
'request_reason': leave_reason,
'exit_re_entry': exit_entry,
'attachment_ids': attach,
'create_air_ticket_request': 'no'
}
leaves += request.env['hr.leave'].sudo().create(create_leave)