diff --git a/addons/web_editor/static/src/js/editor/snippets.editor.js b/addons/web_editor/static/src/js/editor/snippets.editor.js index 0f9adacdfe4..7f51ee7749d 100644 --- a/addons/web_editor/static/src/js/editor/snippets.editor.js +++ b/addons/web_editor/static/src/js/editor/snippets.editor.js @@ -455,8 +455,8 @@ var SnippetEditor = Widget.extend({ for (var i in editor.styles) { editor.styles[i].onRemove(); } - resolve(); }, + onSuccess: resolve, }); }); @@ -669,8 +669,8 @@ var SnippetEditor = Widget.extend({ isCurrent: ($snippet.is($clone)), }); } - resolve(); }, + onSuccess: resolve, }); }); this.trigger_up('snippet_cloned', {$target: $clone, $origin: this.$target}); @@ -2656,7 +2656,8 @@ var SnippetsMenu = Widget.extend({ * @param {OdooEvent} ev */ _onCallForEachChildSnippet: function (ev) { - this._callForEachChildSnippet(ev.data.$snippet, ev.data.callback); + this._callForEachChildSnippet(ev.data.$snippet, ev.data.callback) + .then(() => ev.data.onSuccess()); }, /** * Called when the overlay dimensions/positions should be recomputed.