Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
6 Odpovědi
9632 Zobrazení

Is there an event triggered when a form is shown?

Avatar
Zrušit
Nejlepší odpověď

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
Zrušit
Autor

Thanks a lot.

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

Autor

I guess I need karma 20 to do that.

Nejlepší odpověď

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

Avatar
Zrušit
Autor Nejlepší odpověď

 

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
lis 24
1666
1
zář 21
9441
1
led 24
17051
3
úno 16
6440
0
bře 15
3324