Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
6 Odpowiedzi
9653 Widoki

Is there an event triggered when a form is shown?

Awatar
Odrzuć
Najlepsza odpowiedź

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.

Awatar
Odrzuć
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.

Najlepsza odpowiedź

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

Awatar
Odrzuć
Autor Najlepsza odpowiedź

 

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
lis 24
1672
1
wrz 21
9455
1
sty 24
17062
3
lut 16
6458
0
mar 15
3328