diff --git a/static/src/views/decimal_observer.js b/static/src/views/decimal_observer.js index ac9ced9..ae3629e 100644 --- a/static/src/views/decimal_observer.js +++ b/static/src/views/decimal_observer.js @@ -30,7 +30,8 @@ function processNode(textNode) { // Skip unsafe parents const tagName = parent.tagName; - if (['SCRIPT', 'STYLE', 'TEXTAREA', 'INPUT', 'OPTION', 'TITLE'].includes(tagName)) return; + if (['SCRIPT', 'STYLE', 'TEXTAREA', 'INPUT', 'OPTION', 'TITLE', 'TH'].includes(tagName)) return; + if (parent.closest && parent.closest('th')) return; if (parent.isContentEditable) return; if (parent.closest && parent.closest('[contenteditable="true"]')) return; if (parent.classList.contains('o_decimal')) return; // Already wrapped @@ -38,6 +39,9 @@ function processNode(textNode) { const text = textNode.nodeValue; if (!text || text.length < 3) return; + // Skip if it contains alphabetical words of length 4 or more (non-numeric labels/descriptions) + if (/[a-zA-Z]{4,}/.test(text)) return; + // Get the correct decimal point from Odoo localization const decimalPoint = localization.decimalPoint || '.'; // Escape special regex characters (like dot)