I need to make some pages only available to members.(logged users).
is there any (simple) way to achieve that ?
odoo v12.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
I need to make some pages only available to members.(logged users).
is there any (simple) way to achieve that ?
odoo v12.
Hi,
Simply you can add auth="user" in the controller which render the corresponding page. Once you give the auth="user" in the route the page can be accessed only by the logged in users, if the user iis not logged in system will redirect the user to login page while accessing the same page.
Sample:
@http.route(['/my/task/<model("project.task"):task>'], type='http', auth="user", website=True)
def my_task(self, task=None, **kw):
return request.render("website_project.my_task", {'task': task, 'user': request.env.user})
Thanks
thank you! now I just need to know :
where are stored the controllers for the webpages?
should I use nano to edit the controller, or may I use the web interface?
thanks in advance.
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up
Hope this will helps: http://learnopenerp.blogspot.com/2018/08/odoo-web-controller.html