From d1018bb03167232eaa25a114431d343316d545d2 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Thu, 7 Jun 2012 16:19:30 +0200 Subject: [PATCH] [FIX] problem with m2m and default values lp bug: https://launchpad.net/bugs/997019 fixed bzr revid: nicolas.vanhoren@openerp.com-20120607141930-f9q4gg88d0fe9yyq --- addons/web/static/src/js/view_form.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index b8ea69d1c35..a87ff502d94 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -3287,6 +3287,9 @@ instance.web.form.FieldMany2Many = instance.web.form.AbstractField.extend({ self.reload_content(); this.is_setted.resolve(); }, + get_value: function() { + return [commands.replace_with(this.get('value'))]; + }, load_view: function() { var self = this; this.list_view = new instance.web.form.Many2ManyListView(this, this.dataset, false, { @@ -3316,7 +3319,7 @@ instance.web.form.FieldMany2Many = instance.web.form.AbstractField.extend({ }); }, dataset_changed: function() { - this.set({'value': [commands.replace_with(this.dataset.ids)]}); + this.set({'value': this.dataset.ids}); }, });