Se rendre au contenu
Menu
Cette question a été signalée
6 Réponses
9652 Vues

Is there an event triggered when a form is shown?

Avatar
Ignorer
Meilleure réponse

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
Ignorer
Auteur

Thanks a lot.

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

Auteur

I guess I need karma 20 to do that.

Meilleure réponse

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

Avatar
Ignorer
Auteur Meilleure réponse

 

Avatar
Ignorer
Publications associées Réponses Vues Activité
1
nov. 24
1672
1
sept. 21
9454
1
janv. 24
17062
3
févr. 16
6457
0
mars 15
3328