[fix] possible problem in m2o

bzr revid: nicolas.vanhoren@openerp.com-20120405145322-drzvg42ycfnjxzp4
This commit is contained in:
niv-openerp 2012-04-05 16:53:22 +02:00
parent f0d4dcd0ca
commit a79b771fcc
1 changed files with 7 additions and 0 deletions

View File

@ -2170,6 +2170,7 @@ openerp.web.form.FieldMany2One = openerp.web.form.AbstractField.extend(_.extend(
this.display_value = {};
this.last_search = [];
this.floating = false;
this.inhibit_on_change = false;
},
start: function() {
this._super();
@ -2177,6 +2178,9 @@ openerp.web.form.FieldMany2One = openerp.web.form.AbstractField.extend(_.extend(
this.on("change:value", this, function() {
this.floating = false;
this.render_value();
if (! this.inhibit_on_change) {
this.on_ui_change();
}
});
},
initialize_content: function() {
@ -2452,7 +2456,10 @@ openerp.web.form.FieldMany2One = openerp.web.form.AbstractField.extend(_.extend(
value = value[0];
}
value = value || false;
this.inhibit_on_change = true;
this.set({value: value});
this.inhibit_on_change = false;
this._super(value);
},
get_value: function() {
return this.get("value");