Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
6 ตอบกลับ
9712 มุมมอง

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.

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

 

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
พ.ย. 24
1731
1
ก.ย. 21
9538
1
ม.ค. 24
17114
3
ก.พ. 16
6545
0
มี.ค. 15
3397