콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
4907 화면

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

관련 게시물 답글 화면 활동
1
5월 24
2852
2
9월 23
2577
1
8월 23
2885
1
1월 23
32822
3
10월 22
22223