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
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
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
Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!
DaftarPost Terkait | Replies | Tampilan | Aktivitas | |
---|---|---|---|---|
get Job_ids from hr_contracts one2many field
Diselesaikan
|
|
1
Mei 24
|
2570 | |
Odoo 15: Related fields in an inherit module
Diselesaikan
|
|
2
Sep 23
|
2297 | |
|
1
Agu 23
|
2587 | ||
How to add a related field Many2one in ORM?
Diselesaikan
|
|
1
Jan 23
|
32459 | |
|
3
Okt 22
|
21908 |