[addons][trunk] timezones aren't being applied correctly

Bug #925170 reported by Graeme Gellatly
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Confirmed
Low
Unassigned

Bug Description

Timezone is Pacific/Auckland - UTC+13 currently

Client is set to correct timezone, as is host.
Also tested on web-client

Now if a Sales Order is created before 1pm it is dated as yesterday.

The problem seems to be that when calculating the date it uses the servers current time (UTC) and not the clients.

description: updated
Revision history for this message
Amit Parik (amit-parik) wrote :

Hello Greame,

I have tested the same scenario at my end with Pacific/Auckland timezone and it gives a proper result (UTC+13).

I have created a sale order before 1pm then Creation date show tomorrow 1:00 am. It's correct and I have tested with GTK client because web client doesn't apply the timezone from client side.

For more information I have attached a screen-shot, So would you please check it and notify us where you faced the problem.

Thanks and waiting for your reply!

Changed in openobject-addons:
status: New → Incomplete
Revision history for this message
Amit Parik (amit-parik) wrote :
Revision history for this message
Graeme Gellatly (gdgellatly) wrote : Re: [Bug 925170] Re: [addons][trunk] timezones aren't being applied correctly

You can see the error clearly in your own screenshot.

The creation date says 3rd of February, but the date ordered shows 2nd of
February. The date ordered is the day before the current day. Note we are
talking about the creation date, we are talking about the sale order date.

On Thu, Feb 2, 2012 at 8:01 PM, Amit Parik (OpenERP) <email address hidden>wrote:

> ** Attachment added: "Screenshot_datetime.png"
>
> https://bugs.launchpad.net/openobject-addons/+bug/925170/+attachment/2707051/+files/Screenshot_datetime.png
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/925170
>
> Title:
> [addons][trunk] timezones aren't being applied correctly
>
> Status in OpenERP Addons (modules):
> Incomplete
>
> Bug description:
> Timezone is Pacific/Auckland - UTC+13 currently
>
> Client is set to correct timezone, as is host.
> Also tested on web-client
>
> Now if a Sales Order is created before 1pm it is dated as yesterday.
>
> The problem seems to be that when calculating the date it uses the
> servers current time (UTC) and not the clients.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/openobject-addons/+bug/925170/+subscriptions
>

Amit Parik (amit-parik)
Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 3 (openerp-dev-addons3)
importance: Undecided → Low
status: Incomplete → Confirmed
Amit Parik (amit-parik)
Changed in openobject-addons:
assignee: OpenERP R&D Addons Team 3 (openerp-dev-addons3) → nobody
Revision history for this message
Graeme Gellatly (gdgellatly) wrote :

I've had a look further at this, and it is for any date field, or indeed
just any calculation involving a date. It is most obvious with defaults,
but appears universal in that if you have a datetime object (such as the
servers time, but any datetime object), it is first converted to a date
then to local timezone. This is of course the wrong way around. It should
be calculated first as datetime without timestamp, then converted to local
timezone and then converted to date.

Or else the only other reasonable solution is to convert all date fields to
store as UTC datetime but display as a date client side after conversion.

btw, this might seem low priority issue to you, but anyone on the West
Coast of the US right around to Australia and China is going to go mental
with this. These dates are used everywhere. It even cause ir.cron to
chuck an error when scheduling next calls before 1pm.

On Thu, Feb 2, 2012 at 10:19 PM, Amit Parik (OpenERP) <email address hidden>wrote:

> ** Changed in: openobject-addons
> Assignee: OpenERP R&D Addons Team 3 (openerp-dev-addons3) =>
> (unassigned)
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/925170
>
> Title:
> [addons][trunk] timezones aren't being applied correctly
>
> Status in OpenERP Addons (modules):
> Confirmed
>
> Bug description:
> Timezone is Pacific/Auckland - UTC+13 currently
>
> Client is set to correct timezone, as is host.
> Also tested on web-client
>
> Now if a Sales Order is created before 1pm it is dated as yesterday.
>
> The problem seems to be that when calculating the date it uses the
> servers current time (UTC) and not the clients.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/openobject-addons/+bug/925170/+subscriptions
>

Revision history for this message
Gustavo Adrian Marino (gamarino) wrote :

This problem is affecting many date operation on the system.

It is a showstopper for any implementation of the system.

In no case is a low priority issue. It should be marked as critical

Please, reconsider your evaluation

El 2 de febrero de 2012 08:34, Amit Parik (OpenERP) <email address hidden>escribió:

> *** This bug is a duplicate of bug 925361 ***
> https://bugs.launchpad.net/bugs/925361
>
> ** This bug has been marked a duplicate of bug 925361
> [6.1] date values that are initialized as 'defaults' may appear as "off
> by one day" in some countries depending on the time
>
> --
> You received this bug notification because you are a member of OpenERP
> Framework Experts, which is subscribed to OpenERP Addons.
> https://bugs.launchpad.net/bugs/925170
>
> Title:
> [addons][trunk] timezones aren't being applied correctly
>
> Status in OpenERP Addons (modules):
> Confirmed
>
> Bug description:
> Timezone is Pacific/Auckland - UTC+13 currently
>
> Client is set to correct timezone, as is host.
> Also tested on web-client
>
> Now if a Sales Order is created before 1pm it is dated as yesterday.
>
> The problem seems to be that when calculating the date it uses the
> servers current time (UTC) and not the clients.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/openobject-addons/+bug/925170/+subscriptions
>

--

Gustavo Adrian Marino

Mobile: +54 911 5498 2515

Email: <email address hidden>

Skype: gustavo.adrian.marino

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.