diff options
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/js/view_form.js | 4 | ||||
| -rw-r--r-- | addons/web/static/src/xml/base.xml | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index bed0cefbd9e..ba7a689a8a4 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -2501,7 +2501,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 ab242df110b..bbf83d02b0e 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -1118,9 +1118,10 @@ <ul style="list-style: none; padding-left: 2px; display: inline-block;"> <t t-foreach="widget.priorities" t-as="rec" > <li t-att-data-value="rec.click_value" style="display: inline-block;"> - <a href="#" t-att-title="rec.name"> + <a t-if="!widget.get('readonly')" href="#" t-att-title="rec.name"> <i t-att-class="widget.get('value') gte rec.value and 'fa fa-star oe_star_on' or 'fa fa-star oe_star_off'"/> </a> + <span t-if="widget.get('readonly')" t-att-title="rec.name" t-att-class="widget.get('value') gte rec.value and 'oe_e oe_star_on' or 'oe_e oe_star_off'">7</span> </li> </t> </ul> |
