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
- Boekhouding
- Voorraad
- PoS
- Project
- MRP
Deze vraag is gerapporteerd
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
Geniet je van het gesprek? Blijf niet alleen lezen, doe ook mee!
Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!
Aanmelden