跳至内容
菜单
此问题已终结
1 回复
4488 查看

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

形象
丢弃
最佳答案

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

形象
丢弃
编写者

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

编写者

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

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

相关帖文 回复 查看 活动
0
3月 15
5082
2
1月 25
996
2
5月 25
4312
Duplicate 已解决
1
12月 24
16490
2
10月 24
1480