Skip to Content
Menu
This question has been flagged
6 Replies
9688 Rodiniai

Is there an event triggered when a form is shown?

Portretas
Atmesti
Best Answer

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.

Portretas
Atmesti
Autorius

Thanks a lot.

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

Autorius

I guess I need karma 20 to do that.

Best Answer

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

Portretas
Atmesti
Autorius Best Answer

 

Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
1
lapkr. 24
1721
1
rugs. 21
9523
1
saus. 24
17093
3
vas. 16
6530
0
kov. 15
3372