diff --git a/src/common.js b/src/common.js index 2f0309398f..e2691bd49e 100644 --- a/src/common.js +++ b/src/common.js @@ -2888,6 +2888,7 @@ 'minLength': 1, 'highlight': true }, { + 'limit': Sao.config.limit, 'name': 'suggestions', 'source': source, 'displayKey': 'rec_name', @@ -2918,7 +2919,7 @@ } } }); - entry.on('typeahead:selected', match_selected); + entry.on('typeahead:select', match_selected); }; Sao.common.update_completion = function(entry, record, field, model, domain) { diff --git a/src/sao.js b/src/sao.js index 58dffbd53e..73d37430af 100644 --- a/src/sao.js +++ b/src/sao.js @@ -340,6 +340,7 @@ var Sao = {}; this.search_entry.typeahead({ 'highlight': false }, { + 'limit': Sao.config.limit, 'source': this.update.bind(this), 'displayKey': 'record_name', 'templates': { @@ -361,7 +362,7 @@ var Sao = {}; } } }); - this.search_entry.on('typeahead:selected', + this.search_entry.on('typeahead:select', this.match_selected.bind(this)); }, query: function(value) { @@ -371,7 +372,7 @@ var Sao = {}; return this.search_entry.typeahead('val', value); } }, - update: function(query, process) { + update: function(query, sync, async) { if (query != this.query()) { return; } @@ -393,7 +394,7 @@ var Sao = {}; 'icon': s_results[i][5], }); } - process(results); + async(results); }.bind(this)); }, match_selected: function(event_, item, name) { diff --git a/src/view.js b/src/view.js index 8c0f663f81..109ed166f3 100644 --- a/src/view.js +++ b/src/view.js @@ -2611,7 +2611,7 @@ this.entry.data('search', this.read_access()); this.entry.data('create', this.create_access()); }, - _update_completion: function(query, process) { + _update_completion: function(query, sync, async) { var record = this.record(); if (!record) { return; @@ -2628,7 +2628,7 @@ var prm = Sao.common.update_completion(this.entry, record, field, model); - prm.done(process); + prm.done(async); }, _completion_match_selected: function(event_, selected_item, name) { if (selected_item.id == 'search') {