diff options
| author | Géry Debongnie <ged@odoo.com> | 2014-06-27 11:40:37 +0200 |
|---|---|---|
| committer | Géry Debongnie <ged@odoo.com> | 2014-06-27 11:40:37 +0200 |
| commit | 3c1c6888baf4dfd2f774a65a7b57316156bf9a98 (patch) | |
| tree | 189a3f61ca3608a943f9941068e01926700e4888 /addons/web/static/src | |
| parent | e0364ece4735db68bd30355c2e53ce236c2fe39d (diff) | |
[FIX] fix 2 display bugs with expand autocomplete
* the order was reversed
* there was an useless facet with just the string name
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/js/search.js | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index b0b73d28e4f..a8d1571527a 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -1632,13 +1632,12 @@ instance.web.search.ManyToOneField = instance.web.search.CharField.extend({ context: context }).then(function (results) { if (_.isEmpty(results)) { return null; } - return [{label: self.attrs.string}].concat( - _(results).map(function (result) { - return { - label: _.escape(result[1]), - facet: facet_from(self, result) - }; - })); + return _(results).map(function (result) { + return { + label: _.escape(result[1]), + facet: facet_from(self, result) + }; + }); }); }, facet_for: function (value) { @@ -2436,7 +2435,7 @@ instance.web.search.AutoComplete = instance.web.Widget.extend({ expand: function () { var self = this; this.current_result.expand(this.get_search_string()).then(function (results) { - (results || [{label: '(no result)'}]).forEach(function (result) { + (results || [{label: '(no result)'}]).reverse().forEach(function (result) { result.indent = true; var $li = self.make_list_item(result); self.current_result.$el.after($li); |
