Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
3389 Zobrazení

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

Thanks

Avatar
Zrušit
Nejlepší odpověď

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šit
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 Odpovědi Zobrazení Aktivita
2
lis 22
3824
1
čvc 22
2396
3
lis 21
26055
1
srp 15
5543
2
bře 15
5277