İçereği Atla
Menü
Bu soru işaretlendi
1 Cevapla
3213 Görünümler

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

Thanks

Avatar
Vazgeç
En İyi Yanıt

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
Vazgeç
Üretici

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

İlgili Gönderiler Cevaplar Görünümler Aktivite
2
Kas 22
3624
1
Tem 22
2244
3
Kas 21
25852
1
Ağu 15
5369
2
Mar 15
5277