跳至內容
選單
此問題已被標幟
1666 瀏覽次數

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
頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
3月 15
3629
0
3月 15
4484
1
6月 25
2278
2
6月 25
624
0
5月 25
797