summaryrefslogtreecommitdiff
path: root/addons/web/static/src
diff options
context:
space:
mode:
authorniv-openerp <nicolas.vanhoren@openerp.com>2012-04-05 16:53:22 +0200
committerniv-openerp <nicolas.vanhoren@openerp.com>2012-04-05 16:53:22 +0200
commita79b771fccf47e8e652c5c77b53b24bd4d2bd60e (patch)
treee0945adf6f129bd8b8d0d7a1232fc5bd75be1b66 /addons/web/static/src
parentf0d4dcd0ca783eb945fb29592c7c99a6855a20f9 (diff)
[fix] possible problem in m2o
bzr revid: nicolas.vanhoren@openerp.com-20120405145322-drzvg42ycfnjxzp4
Diffstat (limited to 'addons/web/static/src')
-rw-r--r--addons/web/static/src/js/view_form.js7
1 files changed, 7 insertions, 0 deletions
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");