Anup(OpenERP) has proposed merging 
lp:~openerp-dev/openobject-client/6.0-opw-4721-ach into 
lp:openobject-client/6.0.

Requested reviews:
  Naresh(OpenERP) (nch-openerp)
  Jay Vora (OpenERP) (jvo-openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-client/6.0-opw-4721-ach/+merge/62976

Hello,

   The Calendar view was not respecting the timezone.

To generate follow the below steps.

1. Change the timezone from local say "CET".
2. Create a new meeting at 20:30. The time shown in form,list view are same 
20:30, the time stored in the database is 00:00 of the next date. This is 
normal.
3. Switch to calendar view. You'll see that the calendar view does not respect 
the time that are seen in tree view and form view.It shows 00:00 the same as 
stored in DB without respecting the timezone.

I have fixed the issue.
 
Please check it and share your valuable inputs.

Thanks.


-- 
https://code.launchpad.net/~openerp-dev/openobject-client/6.0-opw-4721-ach/+merge/62976
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-client/6.0-opw-4721-ach.
=== modified file 'bin/widget/view/calendar_gtk/parser.py'
--- bin/widget/view/calendar_gtk/parser.py	2011-02-01 13:58:58 +0000
+++ bin/widget/view/calendar_gtk/parser.py	2011-05-31 12:31:10 +0000
@@ -39,6 +39,7 @@
 from rpc import RPCProxy
 import logging
 import widget.model.field as wmodel_fields
+import tools
 
 COLOR_PALETTE = ['#f57900', '#cc0000', '#d400a8', '#75507b', '#3465a4', '#73d216', '#c17d11', '#edd400',
                  '#fcaf3e', '#ef2929', '#ff00c9', '#ad7fa8', '#729fcf', '#8ae234', '#e9b96e', '#fce94f',
@@ -135,6 +136,7 @@
         self.glade.signal_connect('on_button_month_clicked', self._change_view, 'month')
 
         self.date = datetime.today()
+        self.server_format = '%Y-%m-%d %H:%M:%S'
 
         self.string = attrs.get('string', '')
         self.date_start = attrs.get('date_start')
@@ -426,6 +428,9 @@
     def __get_event(self, model):
 
         event = model.value.copy()
+        # Converts the dates according to the timezone in calendar view
+        event[self.date_start] = tools.datetime_util.server_to_local_timestamp(event.get(self.date_start), self.server_format, self.server_format, tz_offset=True, ignore_unparsable_time=False)
+        event[self.date_stop] = tools.datetime_util.server_to_local_timestamp(event.get(self.date_stop), self.server_format, self.server_format, tz_offset=True, ignore_unparsable_time=False)
         self.__convert(event)
 
         caption = ''

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to