[FIX] Code optimization as per suggestion.

bzr revid: cpa@tinyerp.com-20120607060633-ewnd0kr9qzxw0tey
This commit is contained in:
cpa-openerp
2012-06-07 11:36:33 +05:30
parent 6a572a7730
commit 55954ed199
+1 -1
View File
@@ -2664,7 +2664,7 @@ openerp.web.form.FieldMany2Many = openerp.web.form.Field.extend({
return [commands.replace_with(this.dataset.ids)];
},
validate: function() {
this.invalid = this.required && !this.dataset.ids.length ? true : false ;
this.invalid = this.required && _(this.dataset.ids).isEmpty();
},
is_readonly: function() {
return this.readonly || this.force_readonly;