[MERGE] lp:727900

bzr revid: qdp-launchpad@openerp.com-20110310132215-vvrm02jam6d3x850
This commit is contained in:
Quentin (OpenERP)
2011-03-10 14:22:15 +01:00
2 changed files with 9 additions and 1 deletions
+8
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):
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
using available stage for that case type
@@ -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"/>