Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
3325 Visualizzazioni

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

Thanks

Avatar
Abbandona
Risposta migliore

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
Abbandona
Autore

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

Post correlati Risposte Visualizzazioni Attività
2
nov 22
3753
1
lug 22
2349
3
nov 21
25995
1
ago 15
5522
2
mar 15
5277