diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index f2802c3f5f9..df1b0033569 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -2424,7 +2424,9 @@ instance.web.form.Priority = instance.web.form.FieldChar.extend({ this.record_id = this.view.datarecord.id; this.priorities = this.prepare_priority(); this.$el.html(QWeb.render("Priority", {'widget': this})); - this.$el.find('li').on('click', this.set_priority.bind(this)); + if (!this.get('readonly')){ + this.$el.find('li').on('click', this.set_priority.bind(this)); + } }, /* setting the value: in view mode, perform an asynchronous call and reload the form view; in edit mode, use set_value to save the new value that will diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 864bc899960..145d9a02d95 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -1056,9 +1056,10 @@ diff --git a/addons/web_kanban/static/src/js/kanban.js b/addons/web_kanban/static/src/js/kanban.js index cd92aadf303..fc9c53ed836 100644 --- a/addons/web_kanban/static/src/js/kanban.js +++ b/addons/web_kanban/static/src/js/kanban.js @@ -1300,8 +1300,14 @@ instance.web_kanban.Priority = instance.web_kanban.AbstractField.extend({ var self = this; this.record_id = self.parent.id; this.priorities = self.prepare_priority(); + var readonly = this.field && this.field.readonly; + if (readonly){ + this.set('readonly', true); + } this.$el = $(QWeb.render("Priority", {'widget': this})); - this.$el.find('li').click(self.do_action.bind(self)); + if (!readonly){ + this.$el.find('li').click(self.do_action.bind(self)); + } }, do_action: function(e) { var self = this;