[6.1] Wrong results in search views when filtering by a datetime field if timezone is not UTC
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo GTK Client (MOVED TO GITHUB) |
New
|
Undecided
|
Unassigned |
Bug Description
In GTK client, when you declare a datetime field in a search view, the calendar.py file manages the corresponding widget to show a pair of controls for that field, which allow you to enter a datetime range for your search.
I've detected that the contents of these two controls seem to be managed as UTC times, while the search results are managed (converted back) to your local time. If you see local datetimes, you tend to naturally type time ranges for the search criteria using local times. Error! To be able to see matching records, you must type your search range in UTC times! Furthermore, some (or all) of the results will appear to be outside the range, due to the confusing use of both local and UTC in the same search view.
As this is not very straightforward, I have done a small change to the _value_get method of the datetime class in the widget_