콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
3447 화면

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
3924
1
7월 22
2501
3
11월 21
26258
1
8월 15
5609
2
3월 15
5277