Skip to Content
Menu
This question has been flagged
2 Replies
1911 Views

I am just a beginner in odoo.

I'm trying to get Many2one field in a form view with wizard(models.TransientModel)

I would like to get legal_name under from model (op.admission.register) but there has 

name and legal_name, when i write this code ---------->>>>>

 st_name = fields.Many2one('op.admission.register', string="Name") in TransientModel,


it's always shown names  from (name(field)) , this is not what  i want to do, i just want to see names of legal_name. What should i do ? Please ,Give me some advice. Thank You!!!



Avatar
Discard

Hi.

In the model op.admission.register try to write _rec_name = 'legal_name'

Regards

Hie,

Hannay,

For Many2one you can use the _rec_name = 'legal_name' or you can also override name_get() to format as per your requirement.