Odoo Help


This community 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.


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

Drees Far
on 7/28/15, 5:18 AM 798 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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)


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