Odoo Help


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.


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

on 11/14/14, 4:33 AM 5,162 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
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 community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)


Asked: 11/14/14, 4:33 AM
Seen: 5162 times
Last updated: 4/28/15, 2:47 AM