[IMP] Close m2o autocomplete when user clicks outside

bzr revid: fme@openerp.com-20120816125540-avezmt4797lcaxfd
This commit is contained in:
Fabien Meghazi 2012-08-16 14:55:40 +02:00
parent 56ce5fb54e
commit d52045ef11
1 changed files with 5 additions and 0 deletions

View File

@ -2723,6 +2723,11 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc
this.floating = false;
this.render_value();
});
instance.web.bus.on('click', this, function() {
if (!this.get("effective_readonly") && this.$input && this.$input.autocomplete('widget').is(':visible')) {
this.$input.autocomplete("close");
}
});
},
initialize_content: function() {
if (!this.get("effective_readonly"))