From c6561929f339ac1451cc998b2d2b399253db0016 Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Mon, 24 Oct 2022 16:34:13 +0000 Subject: [PATCH] [REF] web_editor, *: review data-js + data-option-name duplicate *: mass_mailing, website Commit [1] introduced data-option-name allowing to name snippet options without data-js so that their automatic snippet-option-XXX class was not snippet-option-undefined. This was indeed useful to target specific options in tours. The attribute is however a complete duplicate of data-js (if you use one or the other, it does exactly the same thing). Indeed, you can define a data-js without a linked JS class (as it is already done). And if you define both expecting the class using data-option-name but the JS used from data-js that won't be the case, data-option-name is simply ignored. This removes data-option-name. This prepares refactorings that will be done in the future: - The way to define option in XML will be reviewed (probably client side definitions, probably OWL templates). - Adding data-js will probably require a JS class to exist, but all option definitions of Odoo will declare one to ease extensions and stable fixes. Those are theoretical at this point though. This commit main focus is simplifying the code. [1]: https://github.com/odoo/odoo/commit/7b0a147cd43e8e890ebe5a882292a69a5c8c90ac closes odoo/odoo#103988 Signed-off-by: Quentin Smetz (qsm) --- addons/mass_mailing/views/snippets_themes.xml | 4 ++-- addons/web_editor/static/src/js/editor/snippets.editor.js | 6 +++++- addons/website/views/snippets/snippets.xml | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/addons/mass_mailing/views/snippets_themes.xml b/addons/mass_mailing/views/snippets_themes.xml index c81fcec1f71..c8961e36037 100644 --- a/addons/mass_mailing/views/snippets_themes.xml +++ b/addons/mass_mailing/views/snippets_themes.xml @@ -423,7 +423,7 @@ -
+
Auto 50% @@ -538,7 +538,7 @@
-
+
-
+