Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
6 Răspunsuri
9655 Vizualizări

Is there an event triggered when a form is shown?

Imagine profil
Abandonează
Cel mai bun răspuns

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.

Imagine profil
Abandonează
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.

Cel mai bun răspuns

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

Imagine profil
Abandonează
Autor Cel mai bun răspuns

 

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
1
nov. 24
1676
1
sept. 21
9456
1
ian. 24
17064
3
feb. 16
6467
0
mar. 15
3333