vi du nhu class tacgia,class sach voi sach co ten tacgia(chi lay ten tac gia) thi lam sao ?
class Tacgia(models.Model): _name = 'tacgia' ten_tg = fields.Char(string='Ten Tac gia') Nam_sinh = fields.Date( string='Nam Sinh' ) diachitg = fields.Char( string='dia chi Tac Gia' ) class Sach(models.Model): _name = 'sach' def name_get(self,cr,uid,ids,context=None): res=[] for id in ids: elmt=self.browse(cr,uid,id,context=context) res.append((id,self._get_one_full_name(elmt))) return res ten_sach = fields.Char(string='Ten Sach') tentacgia_id = fields.Many2one( 'tacgia', string='Ten Tac Gia', selection=name_get ) ten_nxb = fields.Char(string='Ten Nbx')