diff --git a/addons/web_editor/static/src/js/backend/convert_inline.js b/addons/web_editor/static/src/js/backend/convert_inline.js index 0889c929733..4d1745903a8 100644 --- a/addons/web_editor/static/src/js/backend/convert_inline.js +++ b/addons/web_editor/static/src/js/backend/convert_inline.js @@ -552,11 +552,14 @@ async function toInline($editable, cssRules, $iframe) { $editable.removeClass('odoo-editor-editable'); const editable = $editable.get(0); const iframe = $iframe && $iframe.get(0); + const wysiwyg = $editable.data('wysiwyg'); const doc = editable.ownerDocument; - cssRules = cssRules || doc._rulesCache; + cssRules = cssRules || wysiwyg && wysiwyg._rulesCache; if (!cssRules) { cssRules = getCSSRules(doc); - doc._rulesCache = cssRules; + if (wysiwyg) { + wysiwyg._rulesCache = cssRules; + } } // If the editable is not visible, we need to make it visible in order to diff --git a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js index 7b609bbb685..ad8ff8eb198 100644 --- a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js +++ b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js @@ -2548,6 +2548,7 @@ const Wysiwyg = Widget.extend({ } const {collaborationChannel} = this.options; this._stopPeerToPeer(); + this._rulesCache = undefined; // Reset the cache of rules. // If there is no collaborationResId, the record has been deleted. if (!collaborationChannel || !collaborationChannel.collaborationResId) { this.setValue(value);