From c35bf5a845657606718fa751c20b17bb0e62789c Mon Sep 17 00:00:00 2001 From: Yannick Tivisse Date: Mon, 22 Aug 2016 11:38:04 +0200 Subject: [FIX] web: Set correct debug mode value in headers variable 'X-Debug-Mode' For the need of the next commit, we have to know when making a request from an RPC call in which debug mode we are. Previously, the value was always 'true' if we were in debug mode. Now it will return 'true' if we are in simple debug mode and 'assets' if we are in the other one. (this is the current behavior for the simple WebRequest). Why do we need to know that? When loading the settings dashboard, an rpc request to /web/dataset/call_kw to load the view is accessing the odoo.debug @property method. This value is used in the template to decide which buttons to display to activate or deactivate the debug mode. --- addons/web/static/src/js/framework/session.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/web/static/src/js/framework') diff --git a/addons/web/static/src/js/framework/session.js b/addons/web/static/src/js/framework/session.js index 8f2258e725a..18fccecc331 100644 --- a/addons/web/static/src/js/framework/session.js +++ b/addons/web/static/src/js/framework/session.js @@ -321,7 +321,7 @@ var Session = core.Class.extend(mixins.EventDispatcherMixin, { var shadow = options.shadow || false; options.headers = _.extend({}, options.headers) if (odoo.debug) { - options.headers["X-Debug-Mode"] = true; + options.headers["X-Debug-Mode"] = $.deparam($.param.querystring()).debug; } delete options.shadow; -- cgit v1.2.3