[fix] problem with most related that return a list in a search_default

bzr revid: nicolas.vanhoren@openerp.com-20110826140421-yt204xv30b0ef3vz
This commit is contained in:
niv-openerp
2011-08-26 16:04:21 +02:00
parent b8d25dc2b8
commit c4d8acabba
+2
View 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'));