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

i created a form and now i want to add date on top of the page which should show todays date? How to do that?

아바타
취소
베스트 답변

HI,

You can use computed fields: because its is computed on-the-fly.

Define a Date field with compute. Please try this script:


    date = fields.Date(compute='_compute_date', string='Date')

    def _compute_date(self):

        for record in self:

            end = datetime.date.today()

            record.date = end


Hope this helps.


아바타
취소
작성자 베스트 답변

I want to add on top(header part) not below part..so kindly help me with how to add above part..in ACTION Part...??

아바타
취소