Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
1 Responder
3268 Visualizações

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

Thanks

Avatar
Cancelar
Melhor resposta

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
Cancelar
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

Publicações relacionadas Respostas Visualizações Atividade
2
nov. 22
3672
1
jul. 22
2287
3
nov. 21
25927
1
ago. 15
5429
2
mar. 15
5277