diff options
| author | Romain Derie <rde@odoo.com> | 2019-06-03 14:26:20 +0000 |
|---|---|---|
| committer | Jeremy Kersten <jke@odoo.com> | 2019-06-05 05:56:33 +0000 |
| commit | 72f7139f52a2702ced50730916fe3972bd2d8f09 (patch) | |
| tree | 2b9aa97807d03dad4c175339d8027f63fa90859f /addons/web/static/src/js/services/config.js | |
| parent | 73327db0656bfdd2bce2a69ca1c5c07ad3d3b763 (diff) | |
[IMP] *: use new helper config.isDebug()
Before this commit, both config and session were aliases to odoo.debug.
Now, config.isDebug() should be call, with possibility to pass a parameter to
check if we are in a specific debug mode such as 'tests' or 'assets'.
task-1934445
Coming with https://github.com/odoo/enterprise/pull/4281
Closes https://github.com/odoo/odoo/pull/33213
Diffstat (limited to 'addons/web/static/src/js/services/config.js')
| -rw-r--r-- | addons/web/static/src/js/services/config.js | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/addons/web/static/src/js/services/config.js b/addons/web/static/src/js/services/config.js index 918067f447f..8412c1319a8 100644 --- a/addons/web/static/src/js/services/config.js +++ b/addons/web/static/src/js/services/config.js @@ -11,12 +11,6 @@ odoo.define('web.config', function () { */ var config = { - /** - * debug can be either a boolean, or the special value 'assets' - * - * @type boolean|string - */ - debug: odoo.debug, device: { /** * touch is a boolean, true if the device supports touch interaction @@ -45,6 +39,18 @@ var config = { */ SIZES: { XS: 0, VSM: 1, SM: 2, MD: 3, LG: 4, XL: 5, XXL: 6 }, }, + /** + * States whether the current environment is in debug or not. + * + * @param debugMode the debug mode to check, empty for simple debug mode + * @returns {boolean} + */ + isDebug: function (debugMode) { + if (debugMode) { + return odoo.debug && odoo.debug.indexOf(debugMode) !== -1; + } + return odoo.debug; + }, }; |
