İçereği Atla
Menü
Bu soru işaretlendi
6 Cevaplar
9638 Görünümler

Is there an event triggered when a form is shown?

Avatar
Vazgeç
En İyi Yanıt

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
Vazgeç
Üretici

Thanks a lot.

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

Üretici

I guess I need karma 20 to do that.

En İyi Yanıt

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

Avatar
Vazgeç
Üretici En İyi Yanıt

 

Avatar
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
1
Kas 24
1671
1
Eyl 21
9448
1
Oca 24
17061
3
Şub 16
6443
0
Mar 15
3327