summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2017-11-13 13:01:29 +0100
committerAaron Bohy <aab@odoo.com>2017-11-13 15:12:18 +0100
commit6d616c566f8fbd49d277720c04abd079a04ced76 (patch)
treeb76e2085967e2017508b3ebec23be642a4e8b836
parentc7c3974d612b51d0396f29a7404eec193245e39c (diff)
[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
-rw-r--r--addons/web/static/src/js/chrome/search_inputs.js2
1 files changed, 1 insertions, 1 deletions
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);
}