Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
3 ตอบกลับ
6985 มุมมอง

Hello, 

I have this email template:

The event ${object.event_id.name} that you registered for is confirmed and will be held from ${object.event_id.date_begin} to ${object.event_id.date_end}..

The fields date_begin e date_end are datetime fields and when the email is created the hour that appears is the date saved in database and not the hour in the correct timezone ...

Do you know if there is something like formatLag available in the reports?

Thanks

 

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

There is the email_template_dateutil module in OCA/server-tools:

https://github.com/OCA/server-tools/tree/7.0/email_template_dateutil

This module adds the format_date filter in the email template environment, and can be used like this:

${object.date_invoice|format_date("%m/%d/%Y")}

${object.some_datetime|format_date()}

This will use the current user's timezone by default, or the server timezone, or you can pass in your own timezone.

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hello!

What's the solution for this problem on Odoo 8?

Thank you

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

This one seems to do the job : https://github.com/odoo/odoo/issues/1108

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ก.ย. 17
14760
0
ต.ค. 16
5113
1
ก.พ. 19
7546
0
พ.ย. 16
3781
2
ม.ค. 24
4397