Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
3280 Lượt xem

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

Thanks

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Tác giả

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

Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 11 22
3689
1
thg 7 22
2318
3
thg 11 21
25941
1
thg 8 15
5482
2
thg 3 15
5277