Skip to Content
Menú
This question has been flagged
1792 Vistes
Getting 404 Error for web controller
in Postman http://localhost:8017/school/schoolrecords
File name: controller/controllers.py

# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging

from odoo import http
from odoo.http import request
_logger = logging.getLogger(__name__)
class StudentController(http.Controller):

@http.route('/school/schoolrecords', type='http', auth='public', methods=['GET'])
def getSchoolRecords(self):
school_rec = request.env['school.student'].sudo().search([])
school=[]

for rec in school_rec:
vals={
'id':rec.classid
}
school.append(vals)
return {'student':school}


Avatar
Descartar
Related Posts Respostes Vistes Activitat
3
de juny 24
3021
1
de març 23
3425
0
d’abr. 17
2722
0
de març 15
3773
2
d’abr. 25
2988