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

How to add 1 year to ${object.date_order} in email template ?

By
Ramiro Gómez
on 3/6/14, 5:16 PM 1,096 views

Hello, I need to print the date of the order, but with an added year.

Example: If ${object.date_order} is 2014-03-06, I need to print: "Hi, this order corresponds to the period 2014-03-06 to 2015-03-06".

I managed to extract the year using ${object.date_order[:4]}, but is a string variable. So I can not perform mathematical operations. I do not know how to program in python, but reading I saw that there are functions like "float" or "int" that transform a string into a number. The problem is I can not implement these functions in the template. Every time I try to apply those functions I get an empty body.

Could anyone give me a hand with this?

Thanks !

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: 3/6/14, 5:16 PM
Seen: 1096 times
Last updated: 3/16/15, 8:10 AM