From ca5ddbbcd7906b297973495f67d0df65e68d7439 Mon Sep 17 00:00:00 2001 From: Nicolas Bayet Date: Tue, 26 Apr 2022 14:04:20 +0000 Subject: [PATCH] [IMP] web_editor: disable checklist and stars for readonly Disable checklist and stars when the html field attribute readonly is true. task-2832281 closes odoo/odoo#89845 X-original-commit: 7c87495d34713cf4ea82cfeb376097d67862eb2a Signed-off-by: David Monjoie (dmo) --- addons/web_editor/static/src/js/backend/field_html.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 f5cf305a839..1141fa4c3d4 100644 --- a/addons/web_editor/static/src/js/backend/field_html.js +++ b/addons/web_editor/static/src/js/backend/field_html.js @@ -396,8 +396,10 @@ var FieldHtml = basic_fields.DebouncedField.extend(TranslatableFieldMixin, { } def.then(function () { - self.$content.on('click', 'ul.o_checklist > li', self._onReadonlyClickChecklist.bind(self)); - self.$content.on('click', '.o_stars .fa-star, .o_stars .fa-star-o', self._onReadonlyClickStar.bind(self)); + if (!self.hasReadonlyModifier) { + self.$content.on('click', 'ul.o_checklist > li', self._onReadonlyClickChecklist.bind(self)); + self.$content.on('click', '.o_stars .fa-star, .o_stars .fa-star-o', self._onReadonlyClickStar.bind(self)); + } if (self.$iframe) { // Iframe is hidden until fully loaded to avoid glitches. self.$iframe.removeClass('d-none');