[fix] fixed some problem with quick create showing

bzr revid: nicolas.vanhoren@openerp.com-20110614081046-6nai60903x2qcyde
This commit is contained in:
niv-openerp
2011-06-14 10:10:46 +02:00
parent 802131d422
commit 4c1bfafa12
+4 -1
View File
@@ -1140,7 +1140,10 @@ openerp.base.form.FieldMany2One = openerp.base.form.Field.extend({
});
}});
}
if (self.value === undefined) {
var raw_result = _(data.result).map(function(x) {return x[1];})
if (search_val.length > 0 &&
!_.include(raw_result, search_val) &&
(!self.value || search_val !== self.value[1])) {
values.push({label: '<em>   Create "<strong>' +
$('<span />').text(search_val).html() + '</strong>"</em>', action: function() {
self._quick_create(search_val);