跳至内容
菜单
此问题已终结
1 回复
4657 查看

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
2584
2
9月 23
2338
1
8月 23
2628
1
1月 23
32483
3
10月 22
21927