push_date and send_date are stored with the wrong timezone
Bug #1086393 reported by
Olivier Macchioni
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Report - Printing and Sending |
Fix Released
|
Undecided
|
Guewen Baconnier @ Camptocamp |
Bug Description
They should be converted to UTC before being saved in the DB
Related branches
lp:~camptocamp/report-print-send/pingen-utc-fix-1086393
- Nicolas Bessi - Camptocamp (community): Approve
- Alexandre Fayolle - camptocamp: Approve (code review, no test)
-
Diff: 85 lines (+29/-4)2 files modifiedpingen/pingen.py (+19/-0)
pingen/pingen_document.py (+10/-4)
Changed in report-print-send: | |
assignee: | nobody → Guewen Baconnier @ Camptocamp (gbaconnier-c2c) |
status: | New → Confirmed |
Changed in report-print-send: | |
status: | Confirmed → In Progress |
Changed in report-print-send: | |
status: | In Progress → Fix Committed |
Changed in report-print-send: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
This helper function can help (assuming the OpenERP server is in the same timezone as the pingen server)
def to_utc_time(time): strptime( time, '%Y-%m-%d %H:%M:%S') tzinfo= from_zone) (to_zone)
if isinstance(time, (str, unicode)):
time = datetime.
assert isinstance(time, datetime)
from_zone = tz.tzlocal()
to_zone = tz.tzutc()
time = time.replace(
return time.astimezone