Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
6 Risposte
9658 Visualizzazioni

Is there an event triggered when a form is shown?

Avatar
Abbandona
Risposta migliore

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
Abbandona
Autore

Thanks a lot.

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

Autore

I guess I need karma 20 to do that.

Risposta migliore

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

Avatar
Abbandona
Autore Risposta migliore

 

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
1
nov 24
1680
1
set 21
9458
1
gen 24
17064
3
feb 16
6474
0
mar 15
3336