summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorqsm-odoo <qsm@odoo.com>2016-07-13 15:27:47 +0200
committerqsm-odoo <qsm@odoo.com>2016-07-13 16:13:04 +0200
commit9b77d76e71a55bfc3caba6377cee6370941c5e65 (patch)
tree470e901498e6ffc3dce343f7f62730f7fbbbfadd
parent05a143a416fb3541d93de1b6f7bcb4c4c891cbf0 (diff)
[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.
-rw-r--r--addons/point_of_sale/static/src/js/gui.js3
-rw-r--r--addons/web/static/src/js/action_manager.js2
-rw-r--r--addons/web/static/src/js/apps.js7
-rw-r--r--addons/web/static/src/js/framework/session.js3
-rw-r--r--addons/website/static/src/js/website.theme.js2
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 = $('<iframe>').attr('src', u);
diff --git a/addons/web/static/src/js/framework/session.js b/addons/web/static/src/js/framework/session.js
index 2e643637052..fa83bf79044 100644
--- a/addons/web/static/src/js/framework/session.js
+++ b/addons/web/static/src/js/framework/session.js
@@ -32,7 +32,8 @@ var Session = core.Class.extend(mixins.EventDispatcherMixin, {
this.avoid_recursion = false;
this.use_cors = options.use_cors || false;
this.setup(origin);
- this.debug = ($.deparam($.param.querystring()).debug !== undefined);
+ var debug_param = $.deparam($.param.querystring()).debug;
+ this.debug = (debug_param !== undefined ? debug_param || 1 : false);
// for historic reasons, the session requires a name to properly work
// (see the methods get_cookie and set_cookie). We should perhaps
diff --git a/addons/website/static/src/js/website.theme.js b/addons/website/static/src/js/website.theme.js
index 6b4fd81c7ae..2db3d1c0e5d 100644
--- a/addons/website/static/src/js/website.theme.js
+++ b/addons/website/static/src/js/website.theme.js
@@ -127,7 +127,7 @@ var Theme = Widget.extend({
}
this.$el.addClass('loading');
- if (!reload && !session.debug) {
+ if (!reload && session.debug !== "assets") {
var self = this;
return ajax.jsonRpc('/website/theme_customize', 'call', {
enable: enable,