summaryrefslogtreecommitdiff
path: root/addons/web/static/src
diff options
context:
space:
mode:
authorMohammed Shekha <msh@odoo.com>2020-09-15 12:00:12 +0000
committerAaron Bohy <aab@odoo.com>2020-10-06 07:50:22 +0000
commitc73a54bfc7ef1924533c6741c50b30efc9ee8d21 (patch)
tree11f9e1d9080d1668b5e0ce4877c28ab344a99bda /addons/web/static/src
parent4565a65e99a6dae323fd3d7ddf2010fea102bb91 (diff)
[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) <aab@odoo.com>
Diffstat (limited to 'addons/web/static/src')
-rw-r--r--addons/web/static/src/js/fields/basic_fields.js4
1 files changed, 3 insertions, 1 deletions
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('<a href="#">', index_value >= index+1, index+1, choice[1], index_value));
+ const tag = isReadonly ? '<span>' : '<a href="#">';
+ self.$el.append(self._renderStar(tag, index_value >= index + 1, index + 1, choice[1], index_value));
});
},