Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
3336 มุมมอง

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
3775
1
ก.ค. 22
2362
3
พ.ย. 21
26012
1
ส.ค. 15
5524
Year only needed - how to implement? แก้ไขแล้ว
2
มี.ค. 15
5277