diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index 701f81d335a..8b82ed0cbd2 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -2502,14 +2502,15 @@ instance.web.search.AutoComplete = instance.web.Widget.extend({ }, expand: function () { var self = this; - this.current_result.expand(this.get_search_string()).then(function (results) { + var current_result = this.current_result; + current_result.expand(this.get_search_string()).then(function (results) { (results || [{label: '(no result)'}]).reverse().forEach(function (result) { result.indent = true; var $li = self.make_list_item(result); - self.current_result.$el.after($li); + current_result.$el.after($li); }); - self.current_result.expanded = true; - self.current_result.$el.find('span.oe-expand').html('▼'); + current_result.expanded = true; + current_result.$el.find('span.oe-expand').html('▼'); }); }, fold: function () {