Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
4716 Lượt xem

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

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Tác giả

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

Tác giả

thank you Sandeep i will try

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 5 24
2653
2
thg 9 23
2365
1
thg 8 23
2680
1
thg 1 23
32570
3
thg 10 22
21980