[FIX] problem in m2o when you delete something using the delete button of the keyboard

bzr revid: nicolas.vanhoren@openerp.com-20120808141301-ts4und7qynxh6i3p
This commit is contained in:
niv-openerp 2012-08-08 16:13:01 +02:00
parent 4ae8ce4516
commit 30ff136a83
1 changed files with 4 additions and 3 deletions

View File

@ -2753,7 +2753,7 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc
}); });
// some behavior for input // some behavior for input
this.$input.keydown(function() { var input_changed = function() {
if (self.current_display !== self.$input.val()) { if (self.current_display !== self.$input.val()) {
self.current_display = self.$input.val(); self.current_display = self.$input.val();
if (self.$input.val() === "") { if (self.$input.val() === "") {
@ -2763,7 +2763,9 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc
self.floating = true; self.floating = true;
} }
} }
}); };
this.$input.keydown(input_changed);
this.$input.change(input_changed);
this.$drop_down.click(function() { this.$drop_down.click(function() {
if (self.$input.autocomplete("widget").is(":visible")) { if (self.$input.autocomplete("widget").is(":visible")) {
self.$input.autocomplete("close"); self.$input.autocomplete("close");
@ -2864,7 +2866,6 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc
}); });
this.setupFocus(this.$input.add(this.$follow_button)); this.setupFocus(this.$input.add(this.$follow_button));
}, },
render_value: function(no_recurse) { render_value: function(no_recurse) {
var self = this; var self = this;
if (! this.get("value")) { if (! this.get("value")) {