Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
3252 Vizualizări

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

Thanks

Imagine profil
Abandonează
Cel mai bun răspuns

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

Imagine profil
Abandonează
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 Răspunsuri Vizualizări Activitate
2
nov. 22
3656
1
iul. 22
2273
3
nov. 21
25915
1
aug. 15
5416
2
mar. 15
5277