Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
6351 Vistas

Hi,

I installed  the "Base Rest (OCA)" application in Odoo 13.

I followed the documentation .

So I added in odoo configuration :

[base_rest]
dev_mode=True

I added  controller.py :

class ProductService(Component):
    _inherit = 'base.rest.service'
    _name = 'product.service'
    _collection = 'base.rest.public.services'
    _usage = 'product'
    _description = """
                Product Services !!!
    """
 
    def get(self, _id):
        return self._to_json(self._get(_id))

and component.py :

 class MyRestController(main.RestController):
     _collection_name = "base.rest.public.services"
     _root_path = '/rest_api/public/'
     _default_path = "public"


But , I got 404 error :" The page you requested could not be found" when displaying the URL : http://localhost:8069/rest_api/public/

Any help please ? Can someone explain how to run a simple example with REST APIs.

Thanks.


Avatar
Descartar
Mejor respuesta

I think you are missing "product" in the url and an identifier.

try http://localhost:8069/rest_api/public/product/1

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
3
feb 25
2638
0
may 24
46
1
abr 24
2797
4
sept 23
4232
2
sept 23
6512