From 9b77d76e71a55bfc3caba6377cee6370941c5e65 Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Wed, 13 Jul 2016 15:27:47 +0200 Subject: [PATCH] [FIX] web,website,point_of_sale: session.debug value Now that the debug URL parameter can be equal to "assets", the session debug variable has to be updated to not only be true or false. Now, its value is false if the debug parameter is not specified in the url and a the URL parameter string value otherwise (or 1 if the value is an empty string). Also modify all redirection which kept the debug mode to also keep =assets. Use the $.param.querystring function. --- addons/point_of_sale/static/src/js/gui.js | 3 ++- addons/web/static/src/js/action_manager.js | 2 +- addons/web/static/src/js/apps.js | 7 +++++-- addons/web/static/src/js/framework/session.js | 3 ++- addons/website/static/src/js/website.theme.js | 2 +- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/addons/point_of_sale/static/src/js/gui.js b/addons/point_of_sale/static/src/js/gui.js index 11da0b4441f..365a27b1cc6 100644 --- a/addons/point_of_sale/static/src/js/gui.js +++ b/addons/point_of_sale/static/src/js/gui.js @@ -335,7 +335,8 @@ var Gui = core.Class.extend({ this.chrome.loading_message(_t('Closing ...')); this.pos.push_order().then(function(){ - window.location = '/web' + ((session.debug)? '?debug' : '') + '#action=point_of_sale.action_client_pos_menu'; + var url = "/web#action=point_of_sale.action_client_pos_menu"; + window.location = session.debug ? $.param.querystring(url, {debug: session.debug}) : url; }); }, diff --git a/addons/web/static/src/js/action_manager.js b/addons/web/static/src/js/action_manager.js index 8d33f1ab4ac..ebf2429d2ab 100644 --- a/addons/web/static/src/js/action_manager.js +++ b/addons/web/static/src/js/action_manager.js @@ -835,7 +835,7 @@ var ActionManager = Widget.extend({ ir_actions_act_url: function (action) { var url = action.url; if (session.debug && url && url.length && url[0] === '/') { - url = $.param.querystring(url, 'debug'); + url = $.param.querystring(url, {debug: session.debug}); } if (action.target === 'self') { diff --git a/addons/web/static/src/js/apps.js b/addons/web/static/src/js/apps.js index 5dd5b576fc4..520fb3210c4 100644 --- a/addons/web/static/src/js/apps.js +++ b/addons/web/static/src/js/apps.js @@ -155,8 +155,11 @@ var Apps = Widget.extend({ self.get_client().then(function(client) { self.client = client; - var qs = (session.debug ? 'debug&' : '') + 'db=' + client.dbname; - var u = client.origin + '/apps/embed/client?' + qs; + var qs = {db: client.dbname}; + if (session.debug) { + qs.debug = session.debug; + } + var u = $.param.querystring(client.origin + "/apps/embed/client", qs); var css = {width: '100%', height: '400px'}; self.$ifr = $('