Skip to Content
Menu
Dette spørgsmål er blevet anmeldt
6 Besvarelser
9672 Visninger

Is there an event triggered when a form is shown?

Avatar
Kassér
Bedste svar

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
Kassér
Forfatter

Thanks a lot.

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

Forfatter

I guess I need karma 20 to do that.

Bedste svar

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

Avatar
Kassér
Forfatter Bedste svar

 

Avatar
Kassér
Related Posts Besvarelser Visninger Aktivitet
1
nov. 24
1704
1
sep. 21
9511
1
jan. 24
17087
3
feb. 16
6519
0
mar. 15
3352