[fix] problem with most related that return a list in a search_default
authorniv-openerp <nicolas.vanhoren@openerp.com>
Fri, 26 Aug 2011 14:04:21 +0000 (16:04 +0200)
committerniv-openerp <nicolas.vanhoren@openerp.com>
Fri, 26 Aug 2011 14:04:21 +0000 (16:04 +0200)
bzr revid: nicolas.vanhoren@openerp.com-20110826140421-yt204xv30b0ef3vz

addons/base/static/src/js/search.js

index 99f0778..e3d51e2 100644 (file)
@@ -801,6 +801,8 @@ openerp.base.search.ManyToOneField = openerp.base.search.CharField.extend({
     render: function (defaults) {
         if (defaults[this.attrs.name]) {
             this.id = defaults[this.attrs.name];
+            if (this.id instanceof Array)
+                this.id = this.id[0];
             // TODO: maybe this should not be completely removed
             delete defaults[this.attrs.name];
             this.dataset.name_get([this.id], $.proxy(this, 'on_name_get'));