From e9096a3844459b271cecbcc5e50df4a18c4c3d2a Mon Sep 17 00:00:00 2001 From: "Robin Lejeune (role)" Date: Fri, 30 Jun 2023 08:32:49 +0000 Subject: [PATCH] [FIX] web_editor: allow translations of hidden blocks Steps to reproduce: - Drop a block, hide it on desktop and save - Add a second language and click on translate => This raises an error. The bug happened after the forward-port of [1] to 16.3, because `_updateInvisibleDOM` was called prior to `_loadSnippetsTemplates`: it then tried to `_createSnippetEditor`, requiring `templateOptions` while they were still undefined. opw-3383659 [1]: https://github.com/odoo/odoo/commit/959ea3d361f closes odoo/odoo#127139 X-original-commit: c92ea9f10cdd38b275157e1ba7e79b84e3e45cbb Signed-off-by: Romain Derie (rde) --- addons/web_editor/static/src/js/editor/snippets.editor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 abd20587640..5e9640ab41a 100644 --- a/addons/web_editor/static/src/js/editor/snippets.editor.js +++ b/addons/web_editor/static/src/js/editor/snippets.editor.js @@ -1925,8 +1925,8 @@ var SnippetsMenu = Widget.extend({ if (this.options.enableTranslation) { // Load the sidebar with the style tab only. - defs.push(this._updateInvisibleDOM()); await this._loadSnippetsTemplates(); + defs.push(this._updateInvisibleDOM()); this.$el.find('.o_we_website_top_actions').removeClass('d-none'); this.$('.o_snippet_search_filter').addClass('d-none'); this.$('#o_scroll').addClass('d-none');