Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
6 Replies
9677 Tampilan

Is there an event triggered when a form is shown?

Avatar
Buang
Jawaban Terbai

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.

Avatar
Buang
Penulis

Thanks a lot.

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

Penulis

I guess I need karma 20 to do that.

Jawaban Terbai

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

Avatar
Buang
Penulis Jawaban Terbai

 

Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
1
Nov 24
1710
1
Sep 21
9518
1
Jan 24
17088
3
Feb 16
6528
0
Mar 15
3357