Skip to Content
Menu
This question has been flagged
3472 Views

I have two fields in each class, i need to make relation Many2one between (fn and fn_) and relation Many2one between (ln and ln_). I can't use _rec_name more than one time.

Here is my python file:

class ClassOne(models.Model):
    _name = 'moduleT.one'
    _rec_name = 'fn'
    fn = fields.Char("First name", required=True)

    ln = fields.Char("Last name", required=True)

class ClassTwo(models.Model):
    _name = 'moduleT.two'
    fn_ = fields.Many2one('moduleT.one')
    ln_ = fields.Char("Last name")
    #TO DO: ln_ = fields.Many2one(ln_)
Avatar
Discard

try to use name_get(). i think using that you can achieve your goal

Author

how to do that ?

Related Posts Replies Views Activity
3
Oct 23
5984
1
Sep 23
1975
1
May 23
1007
2
Apr 23
1379
1
Mar 23
997