[fix] problem with char's validity
bzr revid: nicolas.vanhoren@openerp.com-20120319153406-td0j8nu5g20z9ay3
This commit is contained in:
parent
0e4a8c7ff9
commit
4b98b8f127
|
@ -1501,11 +1501,13 @@ openerp.web.form.FieldChar = openerp.web.form.AbstractField.extend(_.extend({},
|
|||
},
|
||||
validate: function() {
|
||||
this.invalid = false;
|
||||
try {
|
||||
var value = openerp.web.parse_value(this.$element.find('input').val(), this, '');
|
||||
this.invalid = this.required && value === '';
|
||||
} catch(e) {
|
||||
this.invalid = true;
|
||||
if (!this.get("effective_readonly")) {
|
||||
try {
|
||||
var value = openerp.web.parse_value(this.$element.find('input').val(), this, '');
|
||||
this.invalid = this.required && value === '';
|
||||
} catch(e) {
|
||||
this.invalid = true;
|
||||
}
|
||||
}
|
||||
},
|
||||
focus: function($element) {
|
||||
|
|
Loading…
Reference in New Issue