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_)
try to use name_get(). i think using that you can achieve your goal
how to do that ?
Here is how you can use nae_get method: http://learnopenerp.blogspot.com/2017/03/how-to-search-many2one-field-by-other.html