From 5c331b606d1dd9630417e7578a22d497bb1969b8 Mon Sep 17 00:00:00 2001 From: "ARA (OpenERP)" Date: Fri, 4 Mar 2011 12:55:51 +0530 Subject: [PATCH] [FIX] hr_recruitment:can not change stage in hr recruitment bzr revid: ara@tinyerp.com-20110304072551-87ioninlg9hbncym --- addons/hr_recruitment/hr_recruitment.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/addons/hr_recruitment/hr_recruitment.py b/addons/hr_recruitment/hr_recruitment.py index 85e447eb919..249da909119 100644 --- a/addons/hr_recruitment/hr_recruitment.py +++ b/addons/hr_recruitment/hr_recruitment.py @@ -185,13 +185,13 @@ class hr_applicant(crm.crm_case, osv.osv): return {'value': result} return {'value': {'department_id': False}} - def onchange_department_id(self,cr, uid, ids, department_id=False, context=None): - obj_recu_stage = self.pool.get('hr.recruitment.stage') - if department_id: - stage_ids = obj_recu_stage.search(cr, uid, ['|',('department_id','=',department_id),('department_id','=',False)], context=context) - if stage_ids: - return {'value': {'stage_id': stage_ids[0]}} - return {'value': {'stage_id': False}} + def onchange_department_id(self, cr, uid, ids, department_id=False, context=None): + if not department_id: + return {'value': {'stage_id': False}} + obj_recru_stage = self.pool.get('hr.recruitment.stage') + stage_ids = obj_recru_stage.search(cr, uid, ['|',('department_id','=',department_id),('department_id','=',False)], context=context) + stage_id = stage_ids and stage_ids[0] or False + return {'value': {'stage_id': stage_id}} def stage_previous(self, cr, uid, ids, context=None): """This function computes previous stage for case from its current stage