From cf2f53e4cf4e8f5e2e2d23c5aaf4554630be68c8 Mon Sep 17 00:00:00 2001 From: Jason Van Malder Date: Thu, 30 Jan 2020 08:16:33 +0000 Subject: [FIX] web_editor: fix required html fields Issue - Studio - Add an required html field - Create new record - Leave it empty It is saved Cause The isSet function of FieldHtml widget, have a "/" in the
tag and summernote empty =


. If you add a space, the value becomes

  

. Solution Remove the "/" and the spaces, check if value !=

&&


OPW-2183687 closes odoo/odoo#44427 X-original-commit: c984b1b1210cea1e63f3bc66cec2120554c76c2a Signed-off-by: Aaron Bohy (aab) --- addons/web_editor/static/src/js/backend/field_html.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'addons/web_editor/static/src') diff --git a/addons/web_editor/static/src/js/backend/field_html.js b/addons/web_editor/static/src/js/backend/field_html.js index 0fe35887a7b..75548eee4b8 100644 --- a/addons/web_editor/static/src/js/backend/field_html.js +++ b/addons/web_editor/static/src/js/backend/field_html.js @@ -116,7 +116,8 @@ var FieldHtml = basic_fields.DebouncedField.extend(TranslatableFieldMixin, { * @override */ isSet: function () { - return this.value && this.value !== "


" && this.value.match(/\S/); + var value = this.value && this.value.split(' ').join('').replace(/\s/g, ''); // Removing spaces & html spaces + return value && value !== "

" && value !== "


" && value.match(/\S/); }, /** * @override -- cgit v1.2.3