[FIX] FieldBoolean: required attribute should be ignored

In order to match the model-level bevahior of boolean
fields, the required attribute should be ignored, as
a NULL value is automatically converted to False, and
considered valid. This contrasts with Char fields, but
is similar to Integer/Float fields, for which NULL values
are converted automatically to 0, and considered valid.

lp bug: https://launchpad.net/bugs/879412 fixed

bzr revid: odo@openerp.com-20111021123510-a8tfpo8h3hqesdcd
This commit is contained in:
Olivier Dony
2011-10-21 14:35:10 +02:00
-3
View File
@@ -1424,9 +1424,6 @@ openerp.web.form.FieldBoolean = openerp.web.form.Field.extend({
this._super.apply(this, arguments);
this.$element.find('input').attr('disabled', this.readonly);
},
validate: function() {
this.invalid = this.required && !this.$element.find('input').is(':checked');
},
focus: function() {
this.$element.find('input').focus();
}