[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.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user