diff --git a/addons/web/static/src/views/helpers/utils.js b/addons/web/static/src/views/helpers/utils.js new file mode 100644 index 0000000000000..8b0c0ff1ff142 --- /dev/null +++ b/addons/web/static/src/views/helpers/utils.js @@ -0,0 +1,13 @@ +/** @odoo-module **/ + +/** + * Parse the arch to check if is true or false + * If the string is empyt, 0, False or false it's considered as false + * The rest is considered as true + * + * @param {string} str + * @returns {boolean} + */ +export function archParseBoolean(str) { + return str !== "False" && str !== "false" && str !== "0" && str !== ""; +}