From 4c8d5dbcfe47934e4cd454258358b3719ea8514a Mon Sep 17 00:00:00 2001 From: FrancoisGe Date: Fri, 17 Feb 2023 08:37:19 +0000 Subject: [PATCH] [FIX] web_editor: Html Field in Record Using the web_editor html field in the Record component causes crashes. Why does this happen? The fields used in the Record component do not always have modifiers. Solution: Use the isReadonly function of the record to know if the field is readonly or not. closes odoo/odoo#113072 X-original-commit: 5354321877b65d577c419255ce43806f648e1708 Signed-off-by: Aaron Bohy (aab) --- addons/web_editor/static/src/js/backend/html_field.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 35f166bcf28..fa053c9d4ce 100644 --- a/addons/web_editor/static/src/js/backend/html_field.js +++ b/addons/web_editor/static/src/js/backend/html_field.js @@ -141,7 +141,7 @@ export class HtmlField extends Component { // Ensure all external links are opened in a new tab. retargetLinks(this.readonlyElementRef.el); - const hasReadonlyModifiers = Boolean(this.props.record.activeFields[this.props.fieldName].modifiers.readonly); + const hasReadonlyModifiers = Boolean(this.props.record.isReadonly(this.props.fieldName)); if (!hasReadonlyModifiers) { const $el = $(this.readonlyElementRef.el); $el.off('.checklistBinding');