From a79b771fccf47e8e652c5c77b53b24bd4d2bd60e Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Thu, 5 Apr 2012 16:53:22 +0200 Subject: [PATCH] [fix] possible problem in m2o bzr revid: nicolas.vanhoren@openerp.com-20120405145322-drzvg42ycfnjxzp4 --- addons/web/static/src/js/view_form.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index de8094572a7..a46de689a99 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -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");