Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
3771 Vizualizări

Hi! My controller for my custom module is as follows:


class MyController(http.Controller):

@http.route('/odoo/', auth='public', type="http", website="True")

def index(self, **kw):

  return "Hello, world"


Let's say http://127.0.0.1/ already brings me to the homepage of my custom module, what I want is for this homepage to instead (or also) be loaded at http://127.0.0.1/odoo. How do I make it so that the adding the /odoo will bring me to the same page that is being loaded at http://127.0.0.1/ ?


Imagine profil
Abandonează
Cel mai bun răspuns

You need to return the homepage template from your route.

@http.route('/odoo/', auth='public', type="http", website="True")
def index(self, **kw):
homepage = request.website.homepage_id
if homepage:
return request.env['ir.http'].reroute(homepage.url)



Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
4
oct. 20
8889
3
feb. 24
10342
1
nov. 23
2773
1
iun. 23
3530
0
feb. 23
2659