From 2ee329f399d130123dbdebec90a7590b0b198f2e Mon Sep 17 00:00:00 2001 From: "ARA (OpenERP)" Date: Fri, 4 Mar 2011 12:14:06 +0530 Subject: [PATCH 1/2] [FIX] hr_recruitment:can not change stage in hr recruitment lp bug: https://launchpad.net/bugs/727900 fixed bzr revid: ara@tinyerp.com-20110304064406-cbvwef86wu5kqph1 --- addons/hr_recruitment/hr_recruitment.py | 8 ++++++++ addons/hr_recruitment/hr_recruitment_view.xml | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/addons/hr_recruitment/hr_recruitment.py b/addons/hr_recruitment/hr_recruitment.py index d6956ab84ba..85e447eb919 100644 --- a/addons/hr_recruitment/hr_recruitment.py +++ b/addons/hr_recruitment/hr_recruitment.py @@ -185,6 +185,14 @@ 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 stage_previous(self, cr, uid, ids, context=None): """This function computes previous stage for case from its current stage using available stage for that case type diff --git a/addons/hr_recruitment/hr_recruitment_view.xml b/addons/hr_recruitment/hr_recruitment_view.xml index 3738a1d8be6..9988be7d368 100644 --- a/addons/hr_recruitment/hr_recruitment_view.xml +++ b/addons/hr_recruitment/hr_recruitment_view.xml @@ -80,7 +80,7 @@