[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
This commit is contained in:
Aaron Bohy
2017-11-13 15:12:18 +01:00
parent c7c3974d61
commit 6d616c566f
@@ -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);
}