[MERGE]:merged sgo's branch

bzr revid: apa@tinyerp.com-20120730132212-hl6fbxil2mnejjw1
This commit is contained in:
Amit Patel (OpenERP) 2012-07-30 18:52:12 +05:30
commit 17fc0c8166
1 changed files with 10 additions and 3 deletions

View File

@ -249,9 +249,6 @@ class hr_applicant(base_stage, osv.Model):
if not stage_id:
return {'value':{}}
stage = self.pool.get('hr.recruitment.stage').browse(cr, uid, stage_id, context)
if stage.state == 'done':
context['onchange'] = True
self.case_close_with_emp(cr, uid, ids, context)
if stage.state == "draft":
return {'value':{'active': True,'date_open': False, 'date_closed': False}}
if stage.state == "open":
@ -463,6 +460,16 @@ class hr_applicant(base_stage, osv.Model):
res = super(hr_applicant, self).case_reset(cr, uid, ids, context)
self.write(cr, uid, ids, {'date_open': False, 'date_closed': False})
return res
def stage_set(self, cr, uid, ids, stage_id, context=None):
if context is None:
context = {}
res = super(hr_applicant, self).stage_set(cr, uid, ids,stage_id, context)
stage = self.pool.get('hr.recruitment.stage').browse(cr, uid, stage_id, context)
if stage.state == 'done':
context['onchange'] = True
self.case_close_with_emp(cr, uid, ids, context)
return res
def set_priority(self, cr, uid, ids, priority, *args):
"""Set applicant priority