I have a class created with the following code
class exp(osv.osv):
_name = "sim.exp"
_description = "xxx"
_columns = {
'building': fields.many2one('sim.buildings','Building',required=True,ondelete='cascade'),
'owner': fields.many2one('sim.student','Name of Owner',required=True,ondelete='cascade'),
}
exp()
I have a specific problem with the owner field which for some reason gives me back the regnum field and I wish to get back the student_name field instead
My sim.student class looks like the following
class student(osv.osv):
_name = "sim.student"
_description = "xxx"
_columns = {
'student_name': fields.char('Name',size=256,required=True),
'regnum': fields.char('Registration Number',size=256,required=True),
'father_name': fields.char('Last Name',size=256),
'gender':fields.selection([('male','Male'),('female','Female')],'Gender'),
'contact_no':fields.char('e-mail',size=256),
'building': fields.many2one('sim.buildings','Consorcio',required=True,ondelete='cascade'),
}
student()
Is there any way to specifically get the student_name ?
Any tip in the right direction will be much appreciated!
It seems you did not specify
rec_namein you `sim.student’ class.Add
rec_namein your class:Hope it will solve your problem.