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

I need to fetch the data using related res_id = fields.many2one('res.partner') name:fields.related('res_id','emp_id.location',type='char',size=64)

i.e i have emp_id and m2o for emp_location and emp_id is stored in res.partner

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

hey Maniganda

you said res_id in your current model , so you can get related field like this

    location=res_id.emp_id.emp_location

now all the value you can get from that location like this:

    name=location.name

and same other field too

thanks
sandeep

อวตาร
ละทิ้ง
ผู้เขียน

this can be possible while creating fields ?? i.e in fields.related

if there is related field then many2one field must be there for thats relation , as you mention in your Q

ผู้เขียน

thank you Sandeep i will try

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
พ.ค. 24
2710
2
ก.ย. 23
2444
1
ส.ค. 23
2742
1
ม.ค. 23
32634
3
ต.ค. 22
22037