Skip to Content
Menu
This question has been flagged
1 Reply
1497 Views

(Model 1)
_name = 'model1.model1'

name = fields.Char() <--


(Model 2)
_name = 'model2.model2'

name = fields.Char()
relationModel1 = fields.Many2one('model1.model1') <--


(Model 3)
_name = 'model3.model3'

name = fields.Char()
relationModel2 = fields.Many2many('model2.model2') <-- how to view  at the TREE list the NAME from model1.model1 without using the ,_rec_name, at model2.model2



Odoo12CE

Avatar
Discard
Best Answer

You can create a related field in model2.model2 like this:

model1_name = fields.Char(related='relationModel1.name')
Avatar
Discard
Author

Thanks for the reply Sam, I will not use _inherit = 'model1.model1' how to make it work

In your Model 2 you do something like this:

_name = 'model2.model2'

name = fields.Char()

relationModel1 = fields.Many2one('model1.model1')

model1_name = fields.Char(related='relationModel1.name')

Author

Thanks Sam,

Related Posts Replies Views Activity
2
Dec 23
11991
0
Oct 23
33
3
Oct 23
787
1
Oct 23
569
1
Aug 23
977