I have 3 objects : students, score and subject
class Student(osv.osv):
_name= "astudent"
_columns={
'name': fields.char(string='Name',size=32),
'subject' : fields.many2many('asubject', 'table', 'stu', 'subj', 'Subject'),
'score' : fields.one2many('ascore','student','Score'),
}
class subject(osv.osv):
_name = "asubject"
_columns={
'name': fields.char('Subject Name'),
'score' : fields.one2many('ascore','subject','Score'),
}
class score(osv.osv):
_name = "ascore"
_columns={
'score': fields.float('Diem', required=True),'student' : fields.many2one('astudent', string='Student', delegate=True, required=True), 'subject' : fields.many2one('asubject', string='Subject', delegate=True, required=True,),
}
In xml file of "astudent", I chose the subject, and after, I will set the "score". I want when I set the "score", I just can chose the "object" (inside "ascore") between the "object" are chosed.
I think I must use "related" or "domain" but I can't do that
Sorry for my bad english, thanks for any help.