Odoo Help

2

How to redirect to the shop website after the customer log in into my system odoo 8?

By
Jose Andres Artavia
on 3/5/15, 7:41 PM 6,183 views

Scenario:

I'm working on a local odoo 8.

I have a website shop that it is not available for public. By the business policies the customer have to sign a contract and then the administrator provide user and password for the customer to be able to shop in our website. 

Using a security rule I'm hiding the shop tab for a public users and it is available back just for registered users. 

Problem:

When a customer log in successfully the system automatically redirect them to the portal. I would like to know if there is a way to modify this in order to redirect our customers to the shop automatically after the log in. 

 

Thank you. 

I am also looking for a solution to this. I tried setting the default new user template to have a default "Home Action" as Website Shop and this redirects them to the shop on login. But then when they clock the "My Account" button they are redirected back to shop, effectively disabling the portal outside of links from within system emails. This is not desired as the customer should be able to select "My account" should they want to see the status of their orders.

grayson
on 3/10/15, 4:16 PM

From where the customer arrives on your login page ? If the link can be customized, you can redirect user to /web?redirect=/shop Once logged, user will be redirected to /shop

Jérémy Kersten (jke)
on 3/10/15, 4:53 PM
4

You can also update the view "web.login" ...

replace

<input type="hidden" name="redirect" t-att-value="redirect"/>

by

<input type="hidden" name="redirect" t-att-value="redirect + '&amp;redirect=/shop' "/>

EDIT 

by:

<input type="hidden" name="redirect" t-att-value="'%s%s' % (redirect or '', (redirect and '&amp;' or '?' ) + 'redirect=/shop' )"/>

Keeping the first redirect is not useless ! ...

/web/login and /web allow redirect as param.

So if a real redirect: (session expired eg)

     /web?#model=res.partner&active_id=1&redirect=/shop --> no redirect (#)

else:

    /web?redirect=/shop --> redirected to /shop

This is working partially. When there is a redirect ie logging in from https://www.example.com/web/login?redirect=https%3A%2F%2Fwww.example.com%2Fweb I get taken to a 404 page at https://www.example.com/web&redirect=/shop Works great when there is no redirect though.

grayson
on 7/8/15, 10:00 AM

Yes, you can update the input with something like that.. it should works... let us know !

Jérémy Kersten (jke)
on 7/8/15, 12:20 PM

Hello this worked for me pretty good. But is there anyway it redirects customers to a page and users (employees) to a different page or directly to system back-end (dashboard)? I have user groups configured and have pages that show or not depending on the group the customer belongs to.

Edser Solis
on 2/28/16, 9:18 PM

2 easy way to do it: or you make the redirect from server side when you know if user is a customer or an employee (python code). Or if you don't want create python code server side (eg: on saas), you redirect always on a dispatcher page... which one will redirect to the right page. (2 simple if in qweb)... if user has group base.group_user -> redirect /xxx , if not has group -> redirect /yyy but it will add a redirect and so a request...

Jérémy Kersten (jke)
on 2/29/16, 3:00 AM
2
Juan José Scarafía
On 7/8/15, 10:11 AM



Hi José Andrés,

In the users you want to change this, you have to complete the field "Menu personalization", completing with the menu you want to redirect, as this images show:


Regards.

Juan José, the problem with this setting, is that if user is a portal user, and want to go to the portal menu, using "my account" option, it bounces again to the website. (previously, it shows portal menu for a while and make a bounce)

Daniel Blanco
on 2/5/16, 2:42 PM
2

@Glen-Erik

You should be able to do exactly the same thing in your template

auth_signup.reset_password

Just replacing 


    <input type="hidden" name="redirect" t-att-value="redirect" />


by


    <input type="hidden" name="redirect" t-att-value="redirect or '/shop'" /> 

 

0
Glen-Erik Cortes
On 7/7/15, 10:59 PM

This works great for web.login but doesn't work for auth_signup.reset_password. What is the syntax or method to change the redirect when someone confirms their account via creating a password?

When you invite someone and they confirm their account, they are sent to the auth_signup.reset_password page to create a password. Then they are redirected to the portal instead of any website page.

About This Community

This platform 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.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

3 follower(s)

Stats

Asked: 3/5/15, 7:41 PM
Seen: 6183 times
Last updated: 10/25/15, 11:40 PM