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.

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 3,846 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
3

Jérémy Kersten (jke)

--Jérémy Kersten (jke)--
2983
| 3 2 5
Jodoigne, Belgium
--Jérémy Kersten (jke)--

Jérémy is a member of the core R&D team since september 2013. He developed several projects for OpenERP version 8 including the eCommerce, the Google Calendar synchronization and the new product variants/configurator. Now, he manages Odoo website and themes for saas.

Jérémy Kersten (jke)
On 3/10/15, 5:11 PM

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

Jérémy Kersten (jke)

--Jérémy Kersten (jke)--
2983
| 3 2 5
Jodoigne, Belgium
--Jérémy Kersten (jke)--

Jérémy is a member of the core R&D team since september 2013. He developed several projects for OpenERP version 8 including the eCommerce, the Google Calendar synchronization and the new product variants/configurator. Now, he manages Odoo website and themes for saas.

Jérémy Kersten (jke)
On 7/8/15, 4:24 AM

@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'" /> 

 

1
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
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.

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

3 follower(s)

Stats

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