Skip to Content
Menu
This question has been flagged
1 Reply
5670 Views

Hello,

     I need to know that how to call function through URL?

Avatar
Discard
Best Answer

You can call a funtion from url using http.route

for example call a function from url www.domain.com/web/my/home

@http.route(['/my/home'], type='http', auth="public", website=True)
def your_function(self, **kw):
     # your code

or if you want to call a function defined inside a model use this inside your function

request.env['your.model'].function_name()


Avatar
Discard
Author

Thank You Mohammed

Related Posts Replies Views Activity
7
Sep 21
25971
3
Sep 22
28128
1
Feb 22
2619
1
Feb 22
4809
0
Nov 21
2748