diff --git a/addons/web_editor/static/src/js/editor/snippets.options.js b/addons/web_editor/static/src/js/editor/snippets.options.js index a0c694f6f91..1cc37cd3d74 100644 --- a/addons/web_editor/static/src/js/editor/snippets.options.js +++ b/addons/web_editor/static/src/js/editor/snippets.options.js @@ -2535,7 +2535,10 @@ const SelectPagerUserValueWidget = SelectUserValueWidget.extend({ } }); -const m2oRpcCache = {}; +let m2oRpcCache = {}; +const clearM2oRpcCache = () => { + m2oRpcCache = {}; +}; const Many2oneUserValueWidget = SelectUserValueWidget.extend({ className: (SelectUserValueWidget.prototype.className || '') + ' o_we_many2one', events: Object.assign({}, SelectUserValueWidget.prototype.events, { @@ -8206,4 +8209,6 @@ export default { // Other names for convenience Class: SnippetOptionWidget, registry: registry, + + clearM2oRpcCache, }; diff --git a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js index 60076f2e246..0ae769905e1 100644 --- a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js +++ b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js @@ -16,6 +16,7 @@ import { device } from "web.config"; import { localization } from "@web/core/l10n/localization"; import * as OdooEditorLib from "@web_editor/js/editor/odoo-editor/src/OdooEditor"; import snippetsEditor from "web_editor.snippet.editor"; +import snippetsOptions from "web_editor.snippets.options"; import Toolbar from "web_editor.toolbar"; import weWidgets from "wysiwyg.widgets"; import Link from "wysiwyg.widgets.Link"; @@ -746,6 +747,7 @@ const Wysiwyg = Widget.extend({ for (const timeout of this.tooltipTimeouts) { clearTimeout(timeout); } + snippetsOptions.clearM2oRpcCache(); this._super(); }, /**