I need to extract month from invoice_date as a custom Character or selection field (NO DATE).
Thanks
Odoo is the world's easiest all-in-one management software.
 It includes hundreds of business apps:
I need to extract month from invoice_date as a custom Character or selection field (NO DATE).
Thanks
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
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
Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !
S'inscrire| Publications associées | Réponses | Vues | Activité | |
|---|---|---|---|---|
|  | 2 nov. 22  | 4391 | ||
|  | 1 juil. 22  | 2780 | ||
|  | 3 nov. 21  | 26788 | ||
|  | 1 août 15  | 6084 | ||
|  | 2 mars 15  | 5277 |