Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
1 Antworten
3308 Ansichten

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

Thanks

Avatar
Verwerfen
Beste Antwort

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

Verknüpfte Beiträge Antworten Ansichten Aktivität
2
Nov. 22
3730
1
Juli 22
2340
3
Nov. 21
25987
1
Aug. 15
5512
2
März 15
5277