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

I am trying to override index method in website module in odoo 11.

Following is my code

from odoo import http
from addons.website.controllers.main import Website
class Home(Website):
@http.route(['/', '/index', '/home'], type='http', website=True, auth='public')
def index(self, **kw):
  super(Website, self).index(**kw)
  return http.request.render('my_website.home')

I have created a new template in my_website named home. But when I go to http://localhost:8069, it is loading the standard odoo template for website with header and footer. When I go to either http://localhost:8069/index or http://localhost:8069/home it is throwing 404 error. It doesn't take my new template home.

I have referred this SO question https://stackoverflow.com/questions/41195759/how-to-change-default-page-of-odoo-with-other-webcontroller-odoo-9-0 but doesn't work.

아바타
취소
관련 게시물 답글 화면 활동
2
2월 24
16302
1
12월 22
5538
2
12월 22
15240
2
6월 22
7284
2
6월 22
5366