Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
4497 Widoki

Hi,

is possible to add login protection to odoo eshop ?

my goal is make all products invisible and show them after you put user name and password.

Thank you.

Mike

Awatar
Odrzuć
Najlepsza odpowiedź

Hi Mike,

Yes this is possible! This behaviour is controlled by the Odoo controllers. So you should override the default controller for the webshop and modify the @http.route so you need to be authenticated before you can see the products. A small example:

@http.route(['/shop'], type='http', auth="user", website=True

In this example the user has to be logged in because of the auth="user" and cannot acces it without being logged in.

Yenthe

Awatar
Odrzuć
Autor

Hi Yenthe, added this code for main page, and works, but when i swich to shop page still see products. If i add your line to controller, nothing happens. line with [/shop] doesnt exist in controller main.py

Autor

my fault, addons/website_sale/controlers/main.py

Good to hear you got it going! Best of luck with Odoo.

Powiązane posty Odpowiedzi Widoki Czynność
0
mar 15
5083
2
sty 25
997
2
maj 25
4316
Duplicate Rozwiązane
1
gru 24
16500
2
paź 24
1481