diff options
| author | Christophe Matthieu <chm@openerp.com> | 2013-07-26 11:26:43 +0200 |
|---|---|---|
| committer | Christophe Matthieu <chm@openerp.com> | 2013-07-26 11:26:43 +0200 |
| commit | 8bc4e0e8a407c6a7f9fe5261ca5a7ffd062d889a (patch) | |
| tree | fd299cb8642e95ba95502daaf6f637d06638c216 /addons | |
| parent | 6a9bbba17e2664f60000c12950626e024b7eb9a8 (diff) | |
[IMP] remove client action goBack and add client action redirect
bzr revid: chm@openerp.com-20130726092643-onck6ad1e2aj7gbo
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/website/controllers/main.py | 1 | ||||
| -rw-r--r-- | addons/website/static/src/js/website.js | 13 | ||||
| -rw-r--r-- | addons/website_sale/views/ecommerce.xml | 2 |
3 files changed, 8 insertions, 8 deletions
diff --git a/addons/website/controllers/main.py b/addons/website/controllers/main.py index 744bfde64d9..65d957784d3 100644 --- a/addons/website/controllers/main.py +++ b/addons/website/controllers/main.py @@ -25,6 +25,7 @@ def template_values(): 'uid': uid, 'script': script, 'css': css, + 'host_url': request.httprequest.host_url, } return values diff --git a/addons/website/static/src/js/website.js b/addons/website/static/src/js/website.js index 34c866cc3b9..0ebb564c200 100644 --- a/addons/website/static/src/js/website.js +++ b/addons/website/static/src/js/website.js @@ -184,13 +184,12 @@ $(function(){ }); -/** - * Client action to go back in global history. - * If can't go back in history stack, will go back to home. - */ -instance.web.ActionGoBack = function(parent, action) { - window.location.href = document.referrer; +instance.web.ActionRedirect = function(parent, action) { + var url = $.deparam(window.location.href).url; + if (url) { + window.location.href = url; + } }; -instance.web.client_actions.add("goback", "instance.web.ActionGoBack"); +instance.web.client_actions.add("redirect", "instance.web.ActionRedirect"); }; diff --git a/addons/website_sale/views/ecommerce.xml b/addons/website_sale/views/ecommerce.xml index 026359c781c..879108f14e2 100644 --- a/addons/website_sale/views/ecommerce.xml +++ b/addons/website_sale/views/ecommerce.xml @@ -204,7 +204,7 @@ </div> <div class="span8 oe_checkout"> <div class="js_inputs row"> - <a t-if="not partner" href="/admin#action=goback" class="btn btn-primary">Log me, I have an account</a> + <a t-if="not partner" t-att-href="'/admin#action=redirect&url=%%s/shop/checkout' %% host_url" class="btn btn-primary">Log me, I have an account</a> <h3 class="span8">Billing Information</h3> <label class="span8 css_required">Name and firstname<input class="span7" type="text" name="name" placeholder="Name and firstname" t-att-value="partner.name or ''"/></label> <label class="span4 css_required">Telephone<input type="tel" name="phone" placeholder="Telephone" t-att-value="partner.phone or ''"/></label> |
