From 592ca1f02e13889ba1d0f15ea7586977fbbe4830 Mon Sep 17 00:00:00 2001 From: Nicolas Bayet Date: Mon, 31 Jul 2023 10:15:37 +0000 Subject: [PATCH] [FIX] web_editor: remove dead code in html_field The template `web_editor.assets_edit_html_field` was not used nor required anymore. The files under that bundle were already included in the backend. The template under the key `cssEditAssetId` in html_field.js is in fact loaded in wysiwyg_iframe.js through the option iframeCssAssets. Moreover, the line `await getBundle` was doing nothing meaningful as the bundle assets would not be loaded after being fetched. task-3446819 closes odoo/odoo#131365 X-original-commit: 4eebfcbdf5428cd1c53bafcd89da7095964ff384 Signed-off-by: David Monjoie (dmo) --- addons/web_editor/static/src/js/backend/html_field.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/addons/web_editor/static/src/js/backend/html_field.js b/addons/web_editor/static/src/js/backend/html_field.js index 3f85f77dca2..9ae37d81b49 100644 --- a/addons/web_editor/static/src/js/backend/html_field.js +++ b/addons/web_editor/static/src/js/backend/html_field.js @@ -46,7 +46,6 @@ export class HtmlField extends Component { dynamicPlaceholder: { type: Boolean, optional: true, default: false }, dynamicPlaceholderModelReferenceField: { type: String, optional: true }, cssReadonlyAssetId: { type: String, optional: true }, - cssEditAssetId: { type: String, optional: true }, isInlineStyle: { type: Boolean, optional: true }, sandboxedPreview: {type: Boolean, optional: true}, wrapper: { type: String, optional: true }, @@ -91,9 +90,6 @@ export class HtmlField extends Component { if (this.props.cssReadonlyAssetId) { this.cssReadonlyAsset = await getBundle(this.props.cssReadonlyAssetId); } - if (this.props.cssEditAssetId || this.props.isInlineStyle) { - await getBundle(this.props.cssEditAssetId || 'web_editor.assets_edit_html_field'); - } }); this._lastRecordInfo = { res_model: this.props.record.resModel, @@ -706,7 +702,6 @@ export const htmlField = { cssReadonlyAssetId: options.cssReadonly, dynamicPlaceholder: options?.dynamic_placeholder || false, dynamicPlaceholderModelReferenceField: options?.dynamic_placeholder_model_reference_field || "", - cssEditAssetId: options.cssEdit, isInlineStyle: options['style-inline'], wysiwygOptions,