Odoo Help


How output a odoo 8 datetime field without time on a qweb report?

on 11/14/14, 4:33 AM 6,100 views

I want output a odoo 8 datetime field in the localization format but without time.
I extended the t-field with a option hide_time.
Is there a simpler build in solution?


Jaydeep Barot (jar)
On 4/28/15, 2:47 AM

You can use below this code. 
<span t-field="o.your_date_field" t-field-options='{"format": "dd/MMM/yyyy"}'/>

Thanks it works for me.

on 10/20/16, 5:56 AM
On 1/16/17, 6:56 AM

Use the below code:

<span t-esc="time.strftime('%m/%d/%Y',time.strptime(object.datetimefield,'%Y-%m-%d %H:%M:%S'))"/>

Original Date field:

01/15/2016 10:41:01

Output Date field:


Sajin Aziz
On 11/15/14, 3:51 AM

You can use  formatLang , <t-esc="formatLang(o.your_datatime_field,date=True)"/>

but u need to override the report ,as given sample code



import time

from openerp.report import report_sxw
from openerp.osv import osv

class QuotationPrint(report_sxw.rml_parse):
    def __init__(self, cr, uid, name, context=None):
        super(QuotationPrint, self).__init__(cr, uid, name, context=context)
            'time': time,
        self.context = context

class quotation(osv.AbstractModel):
    _name = 'report.sale.quotation_template'
    _inherit = 'report.abstract_report'
    _template = 'sale.quotation_template'
    _wrapped_report_class = QuotationPrint


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 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

2 follower(s)


Asked: 11/14/14, 4:33 AM
Seen: 6100 times
Last updated: 1/16/17, 6:56 AM