Odoo Help


What event is triggered when a form view is shown?

Ratmil Torres
on 8/26/14, 10:04 AM 2,727 views

Is there an event triggered when a form is shown?

Ben Olsen
On 8/26/14, 4:02 PM

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."""

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.

Thanks a lot.

Ratmil Torres
on 8/26/14, 4:09 PM

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

Ben Olsen
on 8/26/14, 4:14 PM

I guess I need karma 20 to do that.

Ratmil Torres
on 8/26/14, 4:36 PM
On 6/16/16, 9:54 PM

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

Ratmil Torres
On 2/25/16, 3:11 PM


About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 8/26/14, 10:04 AM
Seen: 2727 times
Last updated: 3/6/17, 10:34 AM