diff --git a/addons/hr_evaluation/hr_evaluation.py b/addons/hr_evaluation/hr_evaluation.py index 752028be527..041ec2d1fd8 100644 --- a/addons/hr_evaluation/hr_evaluation.py +++ b/addons/hr_evaluation/hr_evaluation.py @@ -115,12 +115,11 @@ class hr_employee(osv.osv): return True def onchange_evaluation_plan_id(self, cr, uid, ids, evaluation_plan_id, evaluation_date, context=None): - evaluation_date = evaluation_date or False - evaluation_plan_obj=self.pool.get('hr_evaluation.plan') - obj_evaluation = self.pool.get('hr_evaluation.evaluation') if context is None: context = {} if evaluation_plan_id: + evaluation_plan_obj=self.pool.get('hr_evaluation.plan') + obj_evaluation = self.pool.get('hr_evaluation.evaluation') flag = False evaluation_plan = evaluation_plan_obj.browse(cr, uid, [evaluation_plan_id], context=context)[0] if not evaluation_date: @@ -192,11 +191,11 @@ class hr_evaluation(osv.osv): return res def onchange_employee_id(self, cr, uid, ids, employee_id, context=None): - employee_obj=self.pool.get('hr.employee') if context is None: context = {} - evaluation_plan_id='' + evaluation_plan_id=False if employee_id: + employee_obj=self.pool.get('hr.employee') for employee in employee_obj.browse(cr, uid, [employee_id], context=context): if employee and employee.evaluation_plan_id and employee.evaluation_plan_id.id: evaluation_plan_id=employee.evaluation_plan_id.id diff --git a/addons/hr_recruitment/hr_recruitment.py b/addons/hr_recruitment/hr_recruitment.py index fbb1287afb4..e589a81bde7 100644 --- a/addons/hr_recruitment/hr_recruitment.py +++ b/addons/hr_recruitment/hr_recruitment.py @@ -181,15 +181,15 @@ class hr_applicant(crm.crm_case, osv.osv): } def onchange_job(self,cr, uid, ids, job, context=None): - job_obj = self.pool.get('hr.job') if context is None: context = {} result = {} if job: + job_obj = self.pool.get('hr.job') result['department_id'] = job_obj.browse(cr, uid, job, context=context).department_id.id return {'value': result} - return {'value': {'department_id': []}} + return {'value': {'department_id': False}} def stage_previous(self, cr, uid, ids, context=None): """This function computes previous stage for case from its current stage