Help

2

What event is triggered when a form view is shown?

Avatar
Ratmil Torres

Is there an event triggered when a form is shown?

Avatar
Discard
3 Answers
2
Avatar
Ben Olsen
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.

3 Comments
Avatar
Discard
Avatar
Ratmil Torres
-

Thanks a lot.

Avatar
Ben Olsen
-

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

Avatar
Ratmil Torres
-

I guess I need karma 20 to do that.

0
Avatar
Ehtesham
Best Answer

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

Avatar
Discard
0
Avatar
Ratmil Torres
Best Answer

 

Avatar
Discard