Skip to Content
Menu
This question has been flagged
1 Odpoveď
3388 Zobrazenia

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

Thanks

Avatar
Zrušiť
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
Zrušiť
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 Replies Zobrazenia Aktivita
2
nov 22
3823
1
júl 22
2396
3
nov 21
26051
1
aug 15
5542
2
mar 15
5277