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

Timezone date field Email Template.

By
Gustavo
on 9/30/13, 11:57 AM 2,767 views

I have a little problem with an email template, I include within body_html datetime field, at the time of sending the mail that arrives with the wrong date (over 5 hours) I guess that is the issue of time zones; I have no idea how I can specify in the mail template that should take the user's time zone, I have seen that to address this in the reports with "Aeroo reports" is enclosed in <formatLang(o.f_start, date_time=True)> but for the case of the mail template does not work.

What I can think of at the moment is to create a functional field that returns me the date converted to the time zone of the user but do not think is the most correct way to solve this problem.

I thank you so much any help on the subject.

Not only is the timestamp wrong, it will also use the default formatting (YYYY-MM-DD) instead of the chosen language's format. See also this question : http://help.openerp.com/question/17559/what-is-the-syntax-to-round-numbers-in-the-email-templates/ which is about numbers and getting them formatted correctly.

Agaplan nv, Niels Huylebroeck
on 11/12/13, 1:57 PM

Another search yielded me : http://help.openerp.com/question/15885/how-to-change-email-templates-date-format/

Agaplan nv, Niels Huylebroeck
on 11/12/13, 2:00 PM
1
krishnakanth
On 3/15/16, 4:57 PM

Hi Gustavo,

Can you try this once as follows:

${format_tz(object.date_order, tz=user.tz, context={'lang':object.partner_id.lang})}

As per your email template as follows:

${format_tz(object.f_start, tz=user.tz, context={'lang':object.partner_id.lang})}

Only Date time value:

${format_tz(object.date_order)}

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: 9/30/13, 11:57 AM
Seen: 2767 times
Last updated: 5/5/16, 5:49 PM