콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
2538 화면

i want to add a menu item to the website that i created in odoo but when i try a simple controller i get a 404 error 
# -*- coding: utf-8 -*-from odoo import http# from odoo.http import request
classMyController(http.Controller):@http.route('/mission', website=True, type='http')defindex(self, **kw):

​return"Working!"
the module should be working fine since i already have 2 models running and i see no eroors in the logs 
2023-08-11 09:06:47,773 1 INFO db_web werkzeug: 172.18.0.1 - - [11/Aug/2023 09:06:47] "GET /mission HTTP/1.1" 404 - 22 0.014 0.024

2023-08-11 09:06:48,061 1 INFO db_web werkzeug: 172.18.0.1 - - [11/Aug/2023 09:06:48] "POST /web/dataset/call_kw/web_tour.tour/get_consumed_tours HTTP/1.1" 200 - 4 0.002 0.005

any help would be appreciated

아바타
취소
작성자

Thank you very much !!!

베스트 답변

Hi ahmedkacem,

and this file import in __init__.py of your controller directory like from . import mission  add this it will work fine.


also check below if you have more than 1 controller in same class:

  • Every controller should have unique method names



아바타
취소