Skip to Content
Menú
This question has been flagged
1 Respondre
3216 Vistes

I need to extract month from invoice_date as a custom Character or selection field (NO DATE).

Thanks

Avatar
Descartar
Best Answer

Hi,

Please try like this:- 

import datetime
month = datetime.strptime(self.date_invoice, '%Y-%m-%d').strftime("%B")

It will return the month name.

Regards

Avatar
Descartar
Autor

I forgot to comment that I would like to do it in the frontend, directly in the web as a custom field x_MONTH. And in the model invoice.account.report

Related Posts Respostes Vistes Activitat
2
de nov. 22
3629
1
de jul. 22
2246
3
de nov. 21
25859
1
d’ag. 15
5372
2
de març 15
5277