On my sales quotation report, I convert and format the create_date to present it as the order date. To do so I use:
time.strftime('%d %B %Y', time.strptime(so.create_date, '%Y-%m-%d %H:%M:%S'))
I would also like to show the delivery date by adding 60 days to the create_date. To do this I tried the following:
[[ time.strftime("%d %B %Y",(datetime.strptime(so.create_date,"%Y-%m-%d %H:%M:%S") + timedelta(days=60)).timetuple()) ]]
But this doesn't return anything in the report, even though it works fine when tested from the python command line.
My python test:
>>> print(time.strftime('%d %B %Y',(datetime.strptime('2013-01-01 08:38:01', '%Y-%m-%d %H:%M:%S') + timedelta(days=60)).timetuple()))
which returns:
02 mars 2013
I created a formula in the report (using OpenOffice Writer) and simply replaced the hardcoded date with the field so.create_date.
When requesting the sale quotation report from openerp, this field is always empty.
Any idea why it works from python and not from the report?
What say the OpenERP logs?
2013-03-06 16:36:08,292 7324 INFO ? werkzeug: 127.0.0.1 - - [06/Mar/2013 16:36:08] "POST /web/dataset/search_read HTTP/1.1" 200 -