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 6256ad0c1d5..87d05095a2f 100644 --- a/addons/website/static/src/components/wysiwyg_adapter/wysiwyg_adapter.js +++ b/addons/website/static/src/components/wysiwyg_adapter/wysiwyg_adapter.js @@ -30,6 +30,7 @@ export class WysiwygAdapterComponent extends ComponentAdapter { this.rpc = useWowlService('rpc'); this.orm = useWowlService('orm'); this.dialogs = useWowlService('dialog'); + this.action = useWowlService('action'); this.oeStructureSelector = '#wrapwrap .oe_structure[data-oe-xpath][data-oe-id]'; this.oeFieldSelector = '#wrapwrap [data-oe-field]'; @@ -558,6 +559,11 @@ export class WysiwygAdapterComponent extends ComponentAdapter { const currentPath = encodeURIComponent(window.location.pathname); const websiteId = this.websiteService.currentWebsite.id; callback = () => window.location = `/web#action=website.website_preview&website_id=${websiteId}&path=${currentPath}&enable_editor=1`; + } else if (event.data.action) { + callback = () => { + this.websiteService.leaveEditMode(); + this.action.doAction(event.data.action); + }; } if (isDirty) { return this.save().then(callback); diff --git a/addons/website/static/src/js/editor/snippets.options.js b/addons/website/static/src/js/editor/snippets.options.js index 78759aee1ca..0babf937e95 100644 --- a/addons/website/static/src/js/editor/snippets.options.js +++ b/addons/website/static/src/js/editor/snippets.options.js @@ -1186,7 +1186,7 @@ options.registry.OptionsTab = options.Class.extend({ } this.trigger_up('request_save', { reload: false, - onSuccess: () => window.location.href = '/web#action=website.theme_install_kanban_action', + action: 'website.theme_install_kanban_action', }); },