rest-framework
rest-framework copied to clipboard
Base rest : allow return an http error (404, ...)
With base_rest, it is not possible to return a specific error like 404, 201, ...
it is only return 500 by raise UserError
It is possible to manage the return error ?
You can like this:
from odoo.http import Response
from http import HTTPStatus
...
def get():
return Response(status=HTTPStatus.NOT_FOUND)