From a2cf13eec2fedc163c316ce98140bc1187f620ce Mon Sep 17 00:00:00 2001 From: Nicolas Bayet Date: Mon, 12 Jul 2021 13:04:28 +0000 Subject: [PATCH] [FIX] web_editor: save zone with proper res_model Without this commit, the method `saveModifiedImages` did not use editables zone but rather the whole `$editable`. Because of that, oeModel and oeId were undefined and saving images was done without the proper metadata. That made impossible the retrieval of the images from the method `ir.qweb.field.image` `from_html` defined by the module `web_unsplash`. task-2581567 closes odoo/odoo#77259 X-original-commit: c32ef686e9744fc66f372921fce5cfaff739a76c Signed-off-by: David Monjoie (dmo) --- addons/web_editor/static/src/js/wysiwyg/wysiwyg.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js index 247e5d83e2e..24c82847bc1 100644 --- a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js +++ b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js @@ -601,7 +601,8 @@ const Wysiwyg = Widget.extend({ await this.snippetsMenu.cleanForSave(); } - await this.saveModifiedImages(); + const editables = this.options.getContentEditableAreas(); + await this.saveModifiedImages(editables.length ? $(editables) : this.$editable); await this._saveViewBlocks(); this.trigger_up('edition_was_stopped');