Odoo Help


How to add current date to product label report? [Closed]

on 8/9/13, 8:24 PM 2,322 views

The Question has been closed

Ray Carnes
on 08/15/2013 13:27:55

How do I add the current date to the product label report?


  • I have tried to alter the product_label.xml file by adding a line like this:
  <date type="eval" expr="datetime.datetime.now()"/>
  • But, then I get the following error when executing the print label action: > name 'datetime' is not defined (type 'exceptions.NameError', NameError("name 'datetime' is not defined",), traceback object at 0x7f6024a70fc8)

Any help would be appreciated. -Thx

Ray Carnes
On 8/14/13, 4:34 PM


<date type="function" name="today"/>

This will return the current date in the format DD/MM/YYYY

You can change this to other formats (for example MM/DD/YYYY) by doing something like this in your XSL:

<xsl:value-of select="concat(substring(date, 4, 3),
                             substring(date, 1, 3),substring(date, 7, 4))"/>`

About This Community

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


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 8/9/13, 8:24 PM
Seen: 2322 times
Last updated: 3/16/15, 8:10 AM