summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2017-12-21 11:15:44 +0100
committerAaron Bohy <aab@odoo.com>2018-01-16 20:49:19 +0100
commitde27eaa97161abb06c717a36b7ed68d6f36e4e73 (patch)
tree2f5500a95b40e00f0ca008fdc113f92a93616384
parent285d95e946e5a15139c961e30dbe3598e0d99f6a (diff)
[FIX] web: config.debug and session.debug equivalence
Before this rev., config.debug was always a boolean, whereas it should also encode the special value 'assets', as done in session.
-rw-r--r--addons/web/static/src/js/core/session.js4
-rw-r--r--addons/web/static/src/js/services/config.js13
2 files changed, 11 insertions, 6 deletions
diff --git a/addons/web/static/src/js/core/session.js b/addons/web/static/src/js/core/session.js
index c3181a7abe6..e17b1b0c7fc 100644
--- a/addons/web/static/src/js/core/session.js
+++ b/addons/web/static/src/js/core/session.js
@@ -3,6 +3,7 @@ odoo.define('web.Session', function (require) {
var ajax = require('web.ajax');
var concurrency = require('web.concurrency');
+var config = require('web.config');
var core = require('web.core');
var mixins = require('web.mixins');
var utils = require('web.utils');
@@ -37,8 +38,7 @@ var Session = core.Class.extend(mixins.EventDispatcherMixin, {
this.avoid_recursion = false;
this.use_cors = options.use_cors || false;
this.setup(origin);
- var debug_param = $.deparam($.param.querystring()).debug;
- this.debug = (debug_param !== undefined ? debug_param || 1 : false);
+ this.debug = config.debug;
// 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/web/static/src/js/services/config.js b/addons/web/static/src/js/services/config.js
index 04002b1b381..8a42e755322 100644
--- a/addons/web/static/src/js/services/config.js
+++ b/addons/web/static/src/js/services/config.js
@@ -10,14 +10,19 @@ odoo.define('web.config', function (require) {
* this file someday.
*/
+var debugParam = $.deparam($.param.querystring()).debug;
+var debug = false;
+if (debugParam !== undefined) {
+ debug = debugParam === 'assets' ? 'assets' : true;
+}
+
var config = {
/**
- * debug is a boolean flag. It is only considered true if the flag is set
- * in the url
+ * debug can be either a boolean, or the special value 'assets'
*
- * @type Boolean
+ * @type boolean|string
*/
- debug: ($.deparam($.param.querystring()).debug !== undefined),
+ debug: debug,
device: {
/**
* touch is a boolean, true if the device supports touch interaction