[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
This commit is contained in:
ARA (OpenERP) 2011-03-04 12:14:06 +05:30
parent 4c3c85a945
commit 2ee329f399
2 changed files with 9 additions and 1 deletions

View File

@ -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

View File

@ -80,7 +80,7 @@
<button string="Phone Call" name="%(action_hr_recruitment_phonecall)d" icon="terp-call-start" type="action" groups="base.group_extended"/>
<button name="action_makeMeeting" type="object" string="Meeting" icon="gtk-index"/>
<newline/>
<field name="department_id" widget="selection"/>
<field name="department_id" widget="selection" on_change="onchange_department_id(department_id)"/>
<group colspan="2" col="4">
<field name="stage_id" domain="[('department_id','=',department_id)]"/>
<button name="stage_previous" string="" type="object" icon="gtk-go-back"/>