From c73a54bfc7ef1924533c6741c50b30efc9ee8d21 Mon Sep 17 00:00:00 2001 From: Mohammed Shekha Date: Tue, 15 Sep 2020 12:00:12 +0000 Subject: [FIX] web: do not allow to edit priority field if readonly if readonly attribute is given on priority widget then priority widget should not be clickable and hover effect should be removed so that user can easily understand that field is readonly. task-2339680 closes odoo/odoo#59189 X-original-commit: 53dbfc7a65a8eb2f41d6b2373cf628c4800d1f57 Signed-off-by: Aaron Bohy (aab) --- addons/web/static/src/js/fields/basic_fields.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'addons/web/static/src/js/fields/basic_fields.js') diff --git a/addons/web/static/src/js/fields/basic_fields.js b/addons/web/static/src/js/fields/basic_fields.js index 774fb6462fd..efa9f522c98 100644 --- a/addons/web/static/src/js/fields/basic_fields.js +++ b/addons/web/static/src/js/fields/basic_fields.js @@ -2269,8 +2269,10 @@ var PriorityWidget = AbstractField.extend({ this.$el.empty(); this.empty_value = this.field.selection[0][0]; this.$el.attr('aria-label', this.string); + const isReadonly = this.record.evalModifiers(this.attrs.modifiers).readonly; _.each(this.field.selection.slice(1), function (choice, index) { - self.$el.append(self._renderStar('', index_value >= index+1, index+1, choice[1], index_value)); + const tag = isReadonly ? '' : ''; + self.$el.append(self._renderStar(tag, index_value >= index + 1, index + 1, choice[1], index_value)); }); }, -- cgit v1.2.3