From b20f120cab72dd409a918fbc4e5d9c6c0d613360 Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Tue, 28 Feb 2023 13:59:10 +0000 Subject: [PATCH] [FIX] web_editor: properly hide fa sizes buttons that should be hidden Commit [1] added buttons with a `data-dependency` equal to "fake", thinking it would hide those buttons automatically as the "fake" widget would not exist. Somehow this got merged despite the fact that was not working (testing probably focused on the more important things [1] was fixing). At some point, using a fake dependency was hiding an element but this changed one year earlier with [2]. This commit explicitly hides widgets with `data-dependency="fake"`. [1]: https://github.com/odoo/odoo/commit/f59affcdfe9529645a02680214f3d7d96ebacf6e [2]: https://github.com/odoo/odoo/commit/e927d1e89bc124002bb5e0b69dee711ea0d8147c task-3208632 closes odoo/odoo#113936 X-original-commit: 7a46759a529b2d781585e0dbcb99bf7084c88007 Signed-off-by: Quentin Smetz (qsm) --- addons/web_editor/static/src/js/editor/snippets.options.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/addons/web_editor/static/src/js/editor/snippets.options.js b/addons/web_editor/static/src/js/editor/snippets.options.js index 4d1b3ecd259..34c4fe91548 100644 --- a/addons/web_editor/static/src/js/editor/snippets.options.js +++ b/addons/web_editor/static/src/js/editor/snippets.options.js @@ -3661,6 +3661,12 @@ const SnippetOptionWidget = Widget.extend({ } const dependencies = widget.getDependencies(); + + if (dependencies.length === 1 && dependencies[0] === 'fake') { + widget.toggleVisibility(false); + return; + } + const dependenciesData = []; dependencies.forEach(depName => { const toBeActive = (depName[0] !== '!');