Se rendre au contenu
Menu
Cette question a été signalée
1 Répondre
3314 Vues

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

Thanks

Avatar
Ignorer
Meilleure réponse

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
Ignorer
Auteur

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

Publications associées Réponses Vues Activité
2
nov. 22
3735
1
juil. 22
2345
3
nov. 21
25987
1
août 15
5517
2
mars 15
5277