[FIX] Date form widgets does not handle readonly property

bzr revid: fme@openerp.com-20110630094053-ci91lzfg1cc5qtzu
This commit is contained in:
Fabien Meghazi 2011-06-30 11:40:53 +02:00
parent 0baf6088a3
commit d9d9fa18cf
1 changed files with 4 additions and 0 deletions

View File

@ -904,6 +904,10 @@ openerp.base.form.FieldDatetime = openerp.base.form.Field.extend({
this.value = this.format(this.value);
}
},
update_dom: function() {
this._super.apply(this, arguments);
this.$element.find('input').attr('disabled', this.readonly);
},
validate: function() {
this.invalid = this.required && !this.$element.find('input')[this.jqueryui_object]('getDate');
},