Hi everyone,i modify the module rh and now i want to add a field many2one in an other module from employee who have a job professor but i have this error:
ValueError: Invalid field u'job_id.name' in leaf "<osv.extendedleaf: (u'job_id.name',="" u'=", u" prof')="" on="" hr_job="" (ctx:="" )>"<="" p="">
code of the file.py
enter code hereclass school_matiere(osv.osv):
''' matiere '''
_description ='Information sur les matieres'
_name = 'school.matiere'
_columns = {
'name': fields.char('libelle matiere', size=64, required=True, select=1),
'code': fields.char('Code matiere', size=20, required=True, select=1),
'coef_mat': fields.integer('coefficient matiere'),
'teacher_id': fields.many2one('hr.employee', 'Professeur responsable',required=True),
}
school_matiere()
code of file.xml
enter code here<record model="ir.ui.view" id="view_school_matiere_form">
<field name="name">school.matiere.form</field>
<field name="model">school.matiere</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Matiere" version="7.0">
<sheet>
<group col="6" colspan="4">
<field name="teacher_id" domain="[('job_id.name','=','prof')]"/>
<field name="name" />
<field name="code" />
<field name="coef_mat" />
</group>
</sheet>
</form>
</field>
</record>