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


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

Thank you very much for your answers. I guess there is no way to know the id of the object that will be used to edit in this form.

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi,

fields_view_get() method will be called whenever you clicked your form view.

This is a sample:

def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):

     res = super(class_name, self).fields_view_get(cr, uid, view_id, view_type, context=context, toolbar=toolbar)

     #your modification

     return res

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi,

If you want to do something while opening a form view, you may either override the fields_view_get() method or you may go for a functional field. 

Overriding the fields_view_get() method would be better, and you may find some example references in Odoo addons folder.

Refer this link also: 

http://stackoverflow.com/questions/33654347/how-to-use-fields-view-get-in-odoo-8

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
6
ธ.ค. 22
9677
1
พ.ย. 24
1710
1
ก.ย. 21
9518
1
ม.ค. 24
17087
0
มี.ค. 15
3355