-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpageScript.js
More file actions
21 lines (19 loc) · 734 Bytes
/
Copy pathpageScript.js
File metadata and controls
21 lines (19 loc) · 734 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
let odooVersionType = 'old';
let odooDebugMode = '';
if (window.hasOwnProperty('odoo') && odoo.hasOwnProperty('debug')) {
// before V13, odoo sets "debug" to "true" or "false"
if (typeof odoo.debug === 'boolean') {
const url = window.location.href;
if (url.indexOf('?debug=assets') !== -1) {
odooDebugMode = 'assets';
} else if (url.indexOf('?debug') !== -1) {
odooDebugMode = '1';
}
// In V13 and above odoo sets "debug" to "1" and "0"
} else {
odooDebugMode = odoo.debug;
odooVersionType = 'new';
}
}
document.body.setAttribute('data-odoo-version-type', odooVersionType);
document.body.setAttribute('data-odoo-debug-mode', odooDebugMode);