[FIX] selection field value in case there's no value (haha)

bzr revid: xmo@openerp.com-20111006100235-2x41tzki77sk6i3v
This commit is contained in:
Xavier Morel
2011-10-06 12:02:35 +02:00
parent 0fc5a423e3
commit 06787922c0
+3 -1
View File
@@ -779,7 +779,9 @@ openerp.web.search.SelectionField = openerp.web.search.Field.extend(/** @lends o
});
},
get_value: function () {
return this.attrs.selection[parseInt(this.$element.val(), 10)][0];
var index = parseInt(this.$element.val(), 10);
if (isNaN(index)) { return null; }
return this.attrs.selection[index][0];
}
});
openerp.web.search.BooleanField = openerp.web.search.SelectionField.extend(/** @lends openerp.web.search.BooleanField# */{