From 1dbef66b49d8754c5d874420344e72add3485d4c Mon Sep 17 00:00:00 2001 From: Hetal Dhanak Date: Thu, 10 Jan 2019 07:26:26 +0000 Subject: [FIX] web: date filter operators less than greater than Before this commit, in the filter, when using a custom filter with a date field, the operators "is after" and "is before" were set to execute "is after or equal" and "if before or equal" respectively. That means it includes in the results, records with the same date as the filter. Now, the operators 'is after' and 'is before' won't include the records with the same date as the filter. And the operators 'is after or equal' and 'is before or equal' will include the records with the same date as the filter. Fixes #29868 OPW-1921756 closes odoo/odoo#30560 --- addons/web/static/src/js/chrome/search_filters.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/chrome/search_filters.js b/addons/web/static/src/js/chrome/search_filters.js index 582af7e70ef..4628578f9fe 100644 --- a/addons/web/static/src/js/chrome/search_filters.js +++ b/addons/web/static/src/js/chrome/search_filters.js @@ -180,8 +180,10 @@ var DateTime = Field.extend({ operators: [ {value: "=", text: _lt("is equal to")}, {value: "!=", text: _lt("is not equal to")}, - {value: ">=", text: _lt("is after")}, - {value: "<=", text: _lt("is before")}, + {value: ">", text: _lt("is after")}, + {value: "<", text: _lt("is before")}, + {value: ">=", text: _lt("is after or equal")}, + {value: "<=", text: _lt("is before or equal")}, {value: "between", text: _lt("is between")}, {value: "∃", text: _lt("is set")}, {value: "∄", text: _lt("is not set")} -- cgit v1.2.3 From caacd95a8787b2874a129753b7e5439d0c0c02e8 Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Thu, 24 Jan 2019 10:48:56 +0000 Subject: [FIX] web: allow to open community website menu on iOS Before this commit, the menu to go into the backend from the website was not possible to open on iOS without opening the right menu first. This was because position: fixed is not able to counter overflow: hidden in iOS. This is the fix for stable versions, the proper solution will be done in master. Closes https://github.com/odoo/odoo/issues/29390 task-1923151 closes odoo/odoo#30507 --- addons/web/static/src/less/navbar.less | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/less/navbar.less b/addons/web/static/src/less/navbar.less index 5f3aff0b98f..7b31ec11089 100644 --- a/addons/web/static/src/less/navbar.less +++ b/addons/web/static/src/less/navbar.less @@ -94,7 +94,6 @@ position: relative; height: @odoo-navbar-height; - overflow: hidden; > ul { > li { @@ -110,6 +109,7 @@ &.o_menu_sections { width: 100%; + display: none; > li.open .dropdown-menu { position: static; @@ -158,6 +158,10 @@ .o_main_navbar { height: 100%; overflow: auto; + + .o_menu_sections { + display: block; + } } } } -- cgit v1.2.3 From dc751f20a2da5017644794f68af3cb0f161f77b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Fri, 11 Jan 2019 10:21:49 +0000 Subject: [FIX] web: add exponential backoff strategy for lost connection Before this commit, the web client had a naive strategy to handle lost connections: it tried to poll the server every 2 seconds until a rpc succeeds. This works quite well from the perspective of the user, but may be a problem from the perspective of the server. If a server is down for a longish period, then each users active tabs will then perform a request every 2 seconds. This means that the server will be progressively hammered by many requests, which will clutter the logs, and make it more difficult to gracefully recover. With this commit, we simply exponentially increase the delay each time, and add a little jitter to give a better distribution. Cherry-pick of 4a3f04bcc580c514c61e3bd608fa2b85065434cc closes odoo/odoo#30136 closes odoo/odoo#30596 --- .../web/static/src/js/framework/crash_manager.js | 34 +++++++++++++++------- 1 file changed, 24 insertions(+), 10 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/framework/crash_manager.js b/addons/web/static/src/js/framework/crash_manager.js index 831f762b78c..f36a04eb103 100644 --- a/addons/web/static/src/js/framework/crash_manager.js +++ b/addons/web/static/src/js/framework/crash_manager.js @@ -22,6 +22,7 @@ var map_title ={ var CrashManager = core.Class.extend({ init: function() { this.active = true; + this.isConnected = true; }, enable: function () { this.active = true; @@ -29,8 +30,29 @@ var CrashManager = core.Class.extend({ disable: function () { this.active = false; }, - rpc_error: function(error) { + handleLostConnection: function () { var self = this; + if (!this.isConnected) { + // already handled, nothing to do. This can happen when several + // rpcs are done in parallel and fail because of a lost connection. + return; + } + this.isConnected = false; + var delay = 2000; + core.bus.trigger('connection_lost'); + + setTimeout(function checkConnection() { + ajax.jsonRpc('/web/webclient/version_info', 'call', {}, {shadow:true}).then(function () { + core.bus.trigger('connection_restored'); + self.isConnected = true; + }).fail(function () { + // exponential backoff, with some jitter + delay = (delay * 1.5) + 500*Math.random(); + setTimeout(checkConnection, delay); + }); + }, delay); + }, + rpc_error: function(error) { if (!this.active) { return; } @@ -38,15 +60,7 @@ var CrashManager = core.Class.extend({ return; } if (error.code == -32098) { - core.bus.trigger('connection_lost'); - this.connection_lost = true; - var timeinterval = setInterval(function() { - ajax.jsonRpc('/web/webclient/version_info').then(function() { - clearInterval(timeinterval); - core.bus.trigger('connection_restored'); - self.connection_lost = false; - }); - }, 2000); + this.handleLostConnection(); return; } var handler = core.crash_registry.get(error.data.name, true); -- cgit v1.2.3