diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index 7bbb850a9da..417a564da8e 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -606,10 +606,7 @@
-
diff --git a/addons/procurement_jit/procurement_jit.py b/addons/procurement_jit/procurement_jit.py
index 40360b0aa3a..b519b743488 100644
--- a/addons/procurement_jit/procurement_jit.py
+++ b/addons/procurement_jit/procurement_jit.py
@@ -34,8 +34,7 @@ class procurement_order(osv.osv):
return procurement_id
def run(self, cr, uid, ids, context=None):
- context = context or {}
- context['procurement_autorun_defer'] = True
+ context = dict(context or {}, procurement_autorun_defer=True)
res = super(procurement_order, self).run(cr, uid, ids, context=context)
procurement_ids = self.search(cr, uid, [('move_dest_id.procurement_id', 'in', ids)], order='id', context=context)
diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml
index 43f5463dc8c..9f60e360c41 100644
--- a/addons/stock/stock_view.xml
+++ b/addons/stock/stock_view.xml
@@ -663,7 +663,7 @@
-
+
diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js
index 0dbc206e212..33bc40b3f6f 100644
--- a/addons/web/static/src/js/search.js
+++ b/addons/web/static/src/js/search.js
@@ -525,7 +525,6 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea
this.autocomplete = new my.AutoComplete(this, {
source: this.proxy('complete_global_search'),
select: this.proxy('select_completion'),
- delay: 0,
get_search_string: function () {
return self.$('div.oe_searchview_input').text();
},
@@ -2121,8 +2120,6 @@ instance.web.search.AutoComplete = instance.web.Widget.extend({
// options.source: function ({term:query}, callback). This function will be called to
// obtain the search results corresponding to the query string. It is assumed that
// options.source will call callback with the results.
- // options.delay: delay in millisecond before calling source. Useful if you don't want
- // to make too many rpc calls
// options.select: function (ev, {item: {facet:facet}}). Autocomplete widget will call
// that function when a selection is made by the user
// options.get_search_string: function (). This function will be called by autocomplete
@@ -2131,14 +2128,13 @@ instance.web.search.AutoComplete = instance.web.Widget.extend({
this._super(parent);
this.$input = parent.$el;
this.source = options.source;
- this.delay = options.delay;
- this.select = options.select,
+ this.select = options.select;
this.get_search_string = options.get_search_string;
this.current_result = null;
this.searching = true;
- this.search_string = null;
+ this.search_string = '';
this.current_search = null;
},
start: function () {
@@ -2149,10 +2145,8 @@ instance.web.search.AutoComplete = instance.web.Widget.extend({
ev.preventDefault();
return;
}
- // ENTER is caugth at KeyUp rather than KeyDown to avoid firing
- // before all regular keystrokes have been processed
if (ev.which === $.ui.keyCode.ENTER) {
- if (self.current_result && self.get_search_string().length) {
+ if (self.search_string.length) {
self.select_item(ev);
}
return;
@@ -2161,29 +2155,31 @@ instance.web.search.AutoComplete = instance.web.Widget.extend({
if (self.search_string !== search_string) {
if (search_string.length) {
self.search_string = search_string;
- setTimeout(function () { self.initiate_search(search_string);}, self.delay);
+ self.initiate_search(search_string);
} else {
self.close();
}
}
});
this.$input.on('keypress', function (ev) {
- self.search_string = self.get_search_string() + String.fromCharCode(ev.which);
+ self.search_string = self.search_string + String.fromCharCode(ev.which);
if (self.search_string.length) {
self.searching = true;
var search_string = self.search_string;
- setTimeout(function () { self.initiate_search(search_string);}, self.delay);
+ self.initiate_search(search_string);
} else {
self.close();
}
});
this.$input.on('keydown', function (ev) {
switch (ev.which) {
+ case $.ui.keyCode.ENTER:
+
// TAB and direction keys are handled at KeyDown because KeyUp
// is not guaranteed to fire.
// See e.g. https://github.com/aef-/jquery.masterblaster/issues/13
case $.ui.keyCode.TAB:
- if (self.current_result && self.get_search_string().length) {
+ if (self.search_string.length) {
self.select_item(ev);
}
break;
@@ -2314,7 +2310,7 @@ instance.web.search.AutoComplete = instance.web.Widget.extend({
},
close: function () {
this.current_search = null;
- this.search_string = null;
+ this.search_string = '';
this.searching = true;
this.$el.hide();
},
diff --git a/addons/website_membership/controllers/main.py b/addons/website_membership/controllers/main.py
index 942c3f13267..beedd50a04f 100644
--- a/addons/website_membership/controllers/main.py
+++ b/addons/website_membership/controllers/main.py
@@ -89,7 +89,7 @@ class WebsiteMembership(http.Controller):
# TODO: Following line can be deleted in master. Kept for retrocompatibility.
membership_lines = sorted(membership_lines, key=lambda x: x.membership_id.website_sequence)
partner_ids = [m.partner.id for m in membership_lines]
- free_partner_ids = partner_obj.search(cr, uid, [('free_member', '=', True), ('website_published', '=', True)], context=context)
+ free_partner_ids = partner_obj.search(cr, SUPERUSER_ID, [('free_member', '=', True), ('website_published', '=', True)], context=context)
google_map_partner_ids = ",".join(map(str, partner_ids))
memberships_data = []
for membership_record in memberships: