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.

0

Correct timezone in email template?

By
Anabela Damas
on 10/9/15, 10:29 AM 699 views

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

 

1

Drees Far

--Drees Far--
1130
| 5 2 6
Tunis, Tunisia
--Drees Far--
Drees Far
On 11/6/15, 8:12 AM

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.

0
Mind And Go
On 11/6/15, 4:21 AM

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

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

1 follower(s)

Stats

Asked: 10/9/15, 10:29 AM
Seen: 699 times
Last updated: 11/6/15, 8:12 AM