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

Is there an event triggered when a form is shown?

아바타
취소
베스트 답변

From the base model code:

    def view_init(self, cr, uid, fields_list, context=None):
        """Override this method to do specific things when a view on the object is opened."""
        pass

So in any model, you should be able to override view_init, and put any custom code in there. You don't even need to call super(), because the base class's view_init doesn't do anything.

아바타
취소
작성자

Thanks a lot.

Please mark this answer as accepted if this is what you're looking for. Thanks!

작성자

I guess I need karma 20 to do that.

베스트 답변

@Ratmil
Correct this is only triggered for create new and not for edit.

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

 

아바타
취소
관련 게시물 답글 화면 활동
1
11월 24
1900
1
9월 21
9650
1
1월 24
17239
3
2월 16
6613
0
3월 15
3464