[FIX] web: m2o search facet do no set `default_*` context key for "name_search" values

This commit is contained in:
Christophe Simonis 2014-11-27 17:04:02 +01:00 committed by Denis Ledoux
parent 9b670049b6
commit 5f47fc84e9
1 changed files with 4 additions and 1 deletions

View File

@ -1699,7 +1699,10 @@ instance.web.search.ManyToOneField = instance.web.search.CharField.extend({
var values = facet.values;
if (_.isEmpty(this.attrs.context) && values.length === 1) {
var c = {};
c['default_' + this.attrs.name] = values.at(0).get('value');
var v = values.at(0);
if (v.get('operator') !== 'ilike') {
c['default_' + this.attrs.name] = v.get('value');
}
return c;
}
return this._super(facet);