From 6d616c566f8fbd49d277720c04abd079a04ced76 Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Mon, 13 Nov 2017 13:01:29 +0100 Subject: [PATCH] [FIX] web: search view: autocomplete on datetime fields ... gives wrong values due to the timezone. For instance, let's assume that the browser timezone of the user is UTC+2, and the user types 10/09/2017 10:00:00 in a searchview with a datetime field in its arch (i.e. which autocompletes on a datatime field). Before this rev., the suggested value was 10/09/2017 12:00:00, i.e. the timezone offset was added to the value. opw 779832 --- addons/web/static/src/js/chrome/search_inputs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/static/src/js/chrome/search_inputs.js b/addons/web/static/src/js/chrome/search_inputs.js index d734bb0ebf2..d567551873f 100644 --- a/addons/web/static/src/js/chrome/search_inputs.js +++ b/addons/web/static/src/js/chrome/search_inputs.js @@ -349,7 +349,7 @@ var DateField = Field.extend(/** @lends instance.web.search.DateField# */{ var t, v; try { t = (this.attrs && this.attrs.type === 'datetime') ? 'datetime' : 'date'; - v = field_utils.parse[t](needle, {type: t}); + v = field_utils.parse[t](needle, {type: t}, {timezone: true}); } catch (e) { return $.when(null); }