wip
authorniv-openerp <nicolas.vanhoren@openerp.com>
Mon, 7 Oct 2013 11:56:38 +0000 (13:56 +0200)
committerniv-openerp <nicolas.vanhoren@openerp.com>
Mon, 7 Oct 2013 11:56:38 +0000 (13:56 +0200)
bzr revid: nicolas.vanhoren@openerp.com-20131007115638-9b82rw1azwjtp5fr

addons/web/static/src/js/view_form.js

index 859c78d..06c700e 100644 (file)
@@ -5721,19 +5721,16 @@ instance.web.form.X2ManyCounter = instance.web.form.AbstractField.extend(instanc
             var context = {};
             if (this.field.type === "one2many") {
                 context["default_" + this.field.relation_field] = this.view.datarecord.id;
-            } else if (this.field.type === "many2many") {
-                context["default_" + this.field.relation_field] = [6, 0, [this.view.datarecord.id]];
             }
-            context["search_default_"+ this.field.relation_field] = [this.view.datarecord.id];
+            var domain = [["id", "in", val]];
             return this.do_action({
                 type: 'ir.actions.act_window',
                 name: this.string,
                 res_model: this.field.relation,
-                res_id: val.length >= 1 ? val[0] : false,
-                res_ids: val,
                 views: this.options.views,
                 target: 'current',
                 context: context,
+                domain: domain,
             });
         }, this));
     },