Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

2

Date and time problem

By
Davide
on 6/23/14, 12:30 PM 2,292 views

When I create a new leave request, the related server action create an email with date and time like this:

from '[[object.date_from]]'
to: '[[object.date_to]]'

The time is always wrong (-1 hour). All users are within time zone GTM+1.

How can I send email with propper time (GTM+1)?

 

 

Hi Davide, Did you find a solution for this? So far we are using pytz.timezone.localize to convert from UTC to user's timezone before generating the email, and append the adjusted datetime to the context...

Mario Arias Badila
on 7/24/14, 10:34 PM

I found others are using fields.datetime.context_timestamp to fix this... Just did a couple tests and it works fine...

Mario Arias Badila
on 7/24/14, 10:45 PM
1

Serpent Consulting Services Pvt. Ltd.

--Serpent Consulting Services Pvt. Ltd.--
4341
| 6 6 8
Gandhinagar, India
--Serpent Consulting Services Pvt. Ltd.--

Serpent Consulting Services Pvt. Ltd. Your Odoo/OpenERP Solution, just an email away!

Serpent Consulting Services Pvt. Ltd.
On 6/25/14, 4:48 AM

Davide,

OpenERP server considers everything in GMT standard. If you face the issue of emails having the GMT time, I would consider this as a bug, should be reported.

As a solution, one can write a method which converts the GMTtime into local time and proceed.

Thanks.

0
klacus
On 7/24/14, 10:50 PM

Hi Davide.

You users TimeZone settings is correct?

 

0

Bole

--Bole--
2385
| 5 4 6
Zagreb | Karlovac, Croatia
--Bole--

there is only 10 kind of people the ones that understand binary ... and others

Bole
On 7/25/14, 2:39 AM

The explanation for that is simple.. odoo/openerp server should be always in UTC time... and users timezones should be chosen according to current timezone settings. Odoo will always write UTC times in database (without timezone) and show times in current user time zone.

In your case, i guess that your server is also in GMT timezone(wich is UTC +1) and times shown in your e-mails are -1hr.

You should check your server timezone with: date +%Z

 and if it is not UTC, run: sudo dpkg-reconfigure tzdata  (valid for ubuntu/debian servers)
 

for more info on that matter please refer to this question or serch official documentation

 

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)

Stats

Asked: 6/23/14, 12:30 PM
Seen: 2292 times
Last updated: 3/16/15, 8:10 AM