[6.1] Wrong results in search views when filtering by a datetime field if timezone is not UTC

Bug #1253131 reported by Jordi Llinares - KM Sistemas
6
This bug affects 1 person
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_search/calendar.py of OpenERP 6.1 GTK. It's working for me as expected, so I hope it can be widely applied.

Revision history for this message
Jordi Llinares - KM Sistemas (jorgellinares-deactivatedaccount) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.