Disable clicking on boolean fields when they are readonly

issue5528
review25291002
This commit is contained in:
Sergi Almacellas Abellana 2016-05-04 18:01:39 +02:00
parent 156f4ce32e
commit 2f5692e74e

View file

@ -1294,6 +1294,11 @@
'class': 'form-control input-sm'
}).appendTo(this.el);
this.input.change(this.focus_out.bind(this));
this.input.click(function() {
// Dont trigger click if field is readonly as readonly has no
// effect on checkbox
return !JQuery(this).input.prop('readonly');
});
},
display: function(record, field) {
Sao.View.Form.Boolean._super.display.call(this, record, field);