We have multi websites in odoo16 but one of the website contents we want to keep for login user only . How to set it?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Účtovníctvo
- Sklady
- PoS
- Projektové riadenie
- MRP
This question has been flagged
If the page is delivered through a custom module or you need backend control, use auth='user' in your controller route.
from odoo import http
from odoo.http import request
class RestrictedPage(http.Controller):
@http.route('/my/private/page', auth='user', website=True)
def my_private_page(self, **kwargs):
return request.render('your_module.private_template')
auth='user' → Only logged-in users can access the page
--> If a visitor is not logged in, Odoo automatically redirects them to /web/login
--> After login, they return to the protected page
--> Works per-website if your route includes website_id rules or multi-website template settings
Hope it helps
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Registrácia