date format on Odoo report - Chit Ko Technology

Post Top Ad

Responsive Ads Here
date format on Odoo report

date format on Odoo report

Share This

show date from Python part t

from datetime import datetime,date

def strToDate(dt):    return date(int(dt[0:4]), int(dt[5:7]), int(dt[8:10]))

date_invoice = rec.date_invoice

date_invoice = strToDate(date_invoice).strftime('%d/%m/%Y')


in xml part

<span t-esc="get_amount_untaxed['date_invoice']"/>


normal date format

<span t-field="get_amount_untaxed['date_invoice']"r{"format": "d MMMM y"}'/>

No comments:

Post a Comment

Post Bottom Ad

Responsive Ads Here

Pages