diff --git a/addons/web/common/http.py b/addons/web/common/http.py index a70ef53a91c..f1426d76d27 100644 --- a/addons/web/common/http.py +++ b/addons/web/common/http.py @@ -426,10 +426,13 @@ class DisableCacheMiddleware(object): referer = environ.get('HTTP_REFERER', '') parsed = urlparse.urlparse(referer) debug = parsed.query.count('debug') >= 1 - filtered_headers = [(k,v) for k,v in headers if not (k=='Last-Modified' or (debug and (k=='Cache-Control' or k=='Expires')))] + nh = dict(headers) + if 'Last-Modified' in nh: del nh['Last-Modified'] if debug: - filtered_headers.append(('Cache-Control', 'no-cache')) - start_response(status, filtered_headers) + if 'Expires' in nh: del nh['Expires'] + if 'Etag' in nh: del nh['Etag'] + nh['Cache-Control'] = 'no-cache' + start_response(status, nh.items()) return self.app(environ, start_wrapped) class Root(object): diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index a1759397e21..7c4cdf969f1 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -896,7 +896,8 @@ instance.web.Client = instance.web.Widget.extend({ this.$element.on('click', '.oe_dropdown_toggle', function(ev) { ev.preventDefault(); var $toggle = $(this); - var $menu = $toggle.parent().find('.oe_dropdown_menu'); + var $menu = $toggle.siblings('.oe_dropdown_menu'); + $menu = $menu.size() >= 1 ? $menu : $toggle.find('.oe_dropdown_menu'); var state = $menu.is('.oe_opened'); setTimeout(function() { // Do not alter propagation diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 65afd4a36d6..453de5670c9 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -267,7 +267,6 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM if (this.$pager) { this.$pager.show(); } - this.$element.show().css('visibility', 'hidden'); this.$element.add(this.$buttons).removeClass('oe_form_dirty'); var shown = this.has_been_loaded; @@ -286,7 +285,6 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM if (options.editable) { self.to_edit_mode(); } - self.$element.css('visibility', 'visible'); }); }, do_hide: function () { @@ -2074,7 +2072,7 @@ instance.web.form.FieldChar = instance.web.form.AbstractField.extend(instance.we return this.get('value') === '' || this._super(); }, focus: function() { - this.delay_focus(this.$element.find('input:first')); + this.$element.find('input:first')[0].focus(); } });