Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Odoo 8 eComerce - password protection

By
Mike
on 11/27/15, 4:27 AM 671 views

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

0

Yenthe

--Yenthe--
6686
| 7 7 8
Turnhout, Belgium
--Yenthe--

My Odoo blog: http://www.odoo.yenthevg.com/

My Twitter: https://twitter.com/Yenthe666

Yenthe
On 11/27/15, 5:22 AM

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

Mike
on 11/27/15, 7:13 AM

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

Mike
on 11/27/15, 7:19 AM

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

Yenthe
on 11/27/15, 8:00 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 11/27/15, 4:27 AM
Seen: 671 times
Last updated: 11/27/15, 7:20 AM