[PATCH] Reports in User's Time Zone

Bug #1066067 reported by Martin Collins
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
openobject-jasper-reports
New
Undecided
Unassigned

Bug Description

In 6.1 OpenERP changed datetimes to be stored in UTC timezone. I am in America/Belize timezone (UTC -6). All my jasper_reports now print in UTC.

Adding this patch will allow dates to be converted to the user's timezone:

--- jasper_reports/java/com/nantic/jasperreports/JasperServer.java 2012-03-04 01:25:44 +0000
+++ jasper_reports/java/com/nantic/jasperreports/JasperServer.java 2012-10-12 17:54:36 +0000
@@ -142,6 +142,10 @@
         if ( index != -1 )
             parameters.put( "SUBREPORT_DIR", jrxmlPath.substring( 0, index+1 ) );

+ // Use the user's time zone
+ if ( parameters.containsKey( "report_time_zone" ) )
+ parameters.put( "REPORT_TIME_ZONE", java.util.TimeZone.getTimeZone( parameters.get( "report_time_zone" ).toString() ) );
+
         // Declare it outside the parameters loop because we'll use it when we will create the data source.
         Translator translator = null;

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

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