From d5232aebf94a93b79418674e840c9b7a4d7c87cf Mon Sep 17 00:00:00 2001 From: "Robin Lejeune (role)" Date: Tue, 14 Nov 2023 15:32:20 +0000 Subject: [PATCH] [FIX] website: prevent duplicate code in embed snippet Since the introduction of the Embed Code snippet with [1], in case some content was created dynamically through a `
``` 3. Save and exit the editor. The injected div should appear. 4. Go back to the editor, click to edit the snippet and either save or discard. 5. Exit the editor => The div is duplicated. [1]: https://github.com/odoo/odoo/commit/2cc481d1a62202ade4c1ca8f846c962f9f2cc34d opw-3513760 closes odoo/odoo#152502 X-original-commit: e6fe14dc90af6782693fd5e9dca6f18ecfe7c89a Signed-off-by: Quentin Smetz (qsm) --- addons/website/__manifest__.py | 5 +- addons/website/i18n/website.pot | 31 +++++++++- .../edit_head_body_dialog.xml | 1 + .../resource_editor_warning.xml | 2 +- .../wysiwyg_adapter/wysiwyg_adapter.js | 23 +++++++- addons/website/static/src/js/utils.js | 24 ++++++++ .../static/src/snippets/s_embed_code/000.js | 58 +++++++++++++++++++ .../src/snippets/s_embed_code/options.js | 19 +++++- .../website/static/src/xml/website.editor.xml | 6 ++ .../website/views/snippets/s_embed_code.xml | 3 + 10 files changed, 163 insertions(+), 9 deletions(-) create mode 100644 addons/website/static/src/snippets/s_embed_code/000.js diff --git a/addons/website/__manifest__.py b/addons/website/__manifest__.py index 1aacd6215a2..c138b651c9e 100644 --- a/addons/website/__manifest__.py +++ b/addons/website/__manifest__.py @@ -149,6 +149,9 @@ 'website/static/src/xml/website.background.video.xml', 'website/static/src/xml/website.share.xml', 'website/static/src/js/text_processing.js', + # Stable fix, will be replaced by an `ir.asset` in master to be able + # to clean `