From cdc8e4daad28d0dd1ec5162c05621a6062ae68fb Mon Sep 17 00:00:00 2001 From: Rodolpho Lima Date: Thu, 13 Jul 2023 13:09:12 +0000 Subject: [PATCH] [FIX] web_editor: images stored as base64-encoded sources Commit [1] introduced an option in the Wysiwyg widget to save pasted and dropped images as attachments instead of keeping them as inline base64-encoded sources. In order to prevent records from having excessively large sizes in their html field content, this commit makes such option the default one for the Wysiwyg class. task-3289061 [1]: https://github.com/odoo/odoo/commit/b8e7fb4a5ec8c75deff37dc1737b6a3d3b123cc3 closes odoo/odoo#130213 X-original-commit: 7e06b40ea58f58069729f881f7d4559d17778fe7 Signed-off-by: David Monjoie (dmo) --- addons/web_editor/static/src/js/wysiwyg/wysiwyg.js | 1 + .../static/src/components/wysiwyg_adapter/wysiwyg_adapter.js | 1 - 2 files changed, 1 insertion(+), 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 16dab0efd97..b05b17f782c 100644 --- a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js +++ b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js @@ -262,6 +262,7 @@ export class Wysiwyg extends Component { insertParagraphAfterColumns: true, onHistoryResetFromSteps: () => {}, autostart: true, + dropImageAsAttachment: true, } init() { this.id = ++id; diff --git a/addons/website/static/src/components/wysiwyg_adapter/wysiwyg_adapter.js b/addons/website/static/src/components/wysiwyg_adapter/wysiwyg_adapter.js index e520d85df08..b69782631fe 100644 --- a/addons/website/static/src/components/wysiwyg_adapter/wysiwyg_adapter.js +++ b/addons/website/static/src/components/wysiwyg_adapter/wysiwyg_adapter.js @@ -152,7 +152,6 @@ export class WysiwygAdapterComponent extends Wysiwyg { this.options.toolbarHandler = $('#web_editor-top-edit'); // Do not insert a paragraph after each column added by the column commands: this.options.insertParagraphAfterColumns = false; - this.options.dropImageAsAttachment = true; const $editableWindow = this.$editable[0].ownerDocument.defaultView; // Dropdown menu initialization: handle dropdown openings by hand