Odoo Help

2

What event is triggered when a form view is shown?

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

Is there an event triggered when a form is shown?

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

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
0
Ratmil Torres
On 2/25/16, 3:11 PM

 

0
Ehtesham
On 6/16/16, 9:54 PM

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

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.

Register

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)

Stats

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