跳至內容
選單
此問題已被標幟
1 回覆
3326 瀏覽次數

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

相關帖文 回覆 瀏覽次數 活動
2
11月 22
3755
1
7月 22
2349
3
11月 21
25996
1
8月 15
5522
2
3月 15
5277