From d9c2d03532ae078255fb8dc6d601a5decedbea62 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Tue, 27 Oct 2015 16:20:59 +0100 Subject: [PATCH] [FIX] website_quote: fix Sign & Confirm Commit 7636b51 modifies the route from JSON to HTTP by mistake. Indeed, the route /quote/accept is called from an ajax.jsonRpc request, not from the `method="POST" t-attf-action="/quote/accept` which can be found in website_quotation.xml. The t-attf-action is actually only used to recover the order_id and the token in website_quotation.js. opw-652874 Closes #9227 Fixes #9226 --- addons/website_quote/controllers/main.py | 2 +- addons/website_quote/static/src/js/website_quotation.js | 2 +- addons/website_quote/views/website_quotation.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/website_quote/controllers/main.py b/addons/website_quote/controllers/main.py index c3cbe74c74c..9da22cba870 100644 --- a/addons/website_quote/controllers/main.py +++ b/addons/website_quote/controllers/main.py @@ -77,7 +77,7 @@ class sale_quote(http.Controller): context=render_ctx) return request.website.render('website_quote.so_quotation', values) - @http.route(['/quote/accept/'], type='http', auth="public", website=True, methods=['POST']) + @http.route(['/quote/accept'], type='json', auth="public", website=True) def accept(self, order_id, token=None, signer=None, sign=None, **post): order_obj = request.registry.get('sale.order') order = order_obj.browse(request.cr, SUPERUSER_ID, order_id) diff --git a/addons/website_quote/static/src/js/website_quotation.js b/addons/website_quote/static/src/js/website_quotation.js index 88948908295..c43f3a2e7a6 100644 --- a/addons/website_quote/static/src/js/website_quotation.js +++ b/addons/website_quote/static/src/js/website_quotation.js @@ -64,7 +64,7 @@ if(!$('.o_website_quote').length) { var self = this; var href = self.$el.find('form').attr("action"); var action = href.match(/quote\/([a-z]+)/); - var order_id = href.match(/quote\/[a-z]+\/([0-9]+)/); + var order_id = href.match(/order_id=(.*)&/); var token = href.match(/token=(.*)/); if (token){ token = token[1]; diff --git a/addons/website_quote/views/website_quotation.xml b/addons/website_quote/views/website_quotation.xml index 7d1a454e6d7..edec1d0a6b8 100644 --- a/addons/website_quote/views/website_quotation.xml +++ b/addons/website_quote/views/website_quotation.xml @@ -229,7 +229,7 @@