コンテンツへスキップ
メニュー
この質問にフラグが付けられました
6 返信
9657 ビュー

Is there an event triggered when a form is shown?

アバター
破棄
最善の回答

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.

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

著作者

I guess I need karma 20 to do that.

最善の回答

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

アバター
破棄
著作者 最善の回答

 

アバター
破棄
関連投稿 返信 ビュー 活動
1
11月 24
1680
1
9月 21
9457
1
1月 24
17064
3
2月 16
6473
0
3月 15
3335