Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
3245 Tampilan

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

Thanks

Avatar
Buang
Jawaban Terbai

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
Buang
Penulis

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 Terkait Replies Tampilan Aktivitas
2
Nov 22
3650
1
Jul 22
2265
3
Nov 21
25912
1
Agu 15
5412
2
Mar 15
5277