Skip to Content
Menu
This question has been flagged
3 Replies
2166 Views

when I print an invoice with payment, the invoice date and the due date are formated like I need it (dd.mm.yyyy) but the "paid on" date has the wrong format yy-mm-dd. In the view all dates have the right format.

I found the relevant line in the report (report_invoice_document_with_payments):

<i class="oe_form_field text-right oe_payment_label">Paid on <t t-esc="payment_vals['date']" /></i>

Why is this date in the wrong format and how can I change it (pref. so that it follow the language settings of the user - like the other dates)?

V11 community

Avatar
Discard
Author Best Answer

<t t-esc="payment_vals['date']" />
substituted
<t t-esc="payment_vals['date']"  t-options="{'widget':'date'}"  />


...better than hard code the format!


Avatar
Discard
Best Answer
<span t-esc="time.strftime('%d-%m-%Y', time.strptime(p.date_maturity,'%Y-%m-%d'))"/>
to get the desired format you have to use this formula replace "date maturity" with the field you want to format.
Avatar
Discard