Odoo Help


ValueError: "name 'employee_id' is not defined" while evaluating

Drees Far
on 7/28/15, 5:18 AM 1,298 views

Hello friends :)

Please, i have tried to add some fields in the menu Human Ressources.

So, i use an on_change function which gave me error that i havent resolve yet.

Here is my code:

 def on_change_contract_id(self, cr, uid, ids,  field_name, context=None):
if field_name == False:
My_error_Msg = 'Please, select your EMPLOYEE'
raise osv.except_osv(_("Error!"), _(My_error_Msg))
print employee_id
obj = self.pool.get('hr.contract')
obj_ids = obj.search(cr, uid, [('employee_id', '=', field_name)])
res = obj.read(cr, uid, obj_ids, ['name'], context)
res = {'value':{.................................;
return res

The problem is that i need to work with the employee_id but i didnt understand how to be able to use it when i try the inheritance.

Need an answer please

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 7/28/15, 5:18 AM
Seen: 1298 times
Last updated: 7/28/15, 5:20 AM