Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
3492 Переглядів

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

Related Posts Відповіді Переглядів Дія
2
лист. 22
3976
1
лип. 22
2535
3
лист. 21
26304
1
серп. 15
5655
2
бер. 15
5277