Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
1834 Näkymät

I want to know if there is a way in Odoo to assign a base route to a controller.

By that, I mean: Imagine I have a module called "App1", with a controller offering routes for this app.

I want all my routes to start with "/app1". 

Instead of having to repeat this on every '@route' decorator of my controller, can I set it globally so every route will be prefixed with this global one?


fictional example:

@controller_route('/app1'):
class MyController(Controller):
​@route('home')
​app_home():
​# is accessible via /app1/home
Avatar
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
1
maalisk. 15
3854
0
maalisk. 15
4791
2
elok. 25
2653
2
kesäk. 25
1100
0
toukok. 25
1113