تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
3 الردود
16747 أدوات العرض

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...

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

أفضل إجابة

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.

الصورة الرمزية
إهمال
أفضل إجابة

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

 

الصورة الرمزية
إهمال
أفضل إجابة

Hi Davide.

You users TimeZone settings is correct?

 

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
0
نوفمبر 16
3770
3
يونيو 23
11109
1
يونيو 15
4194
2
يوليو 24
9177
1
يونيو 24
3081