Merge lp:~openerp-dev/openobject-addons/6.0-opw-573199-ksa into lp:openobject-addons/6.0

Proposed by Kirti Savalia(OpenERP)
Status: Approved
Approved by: Naresh(OpenERP)
Approved revision: 5174
Proposed branch: lp:~openerp-dev/openobject-addons/6.0-opw-573199-ksa
Merge into: lp:openobject-addons/6.0
Diff against target: 20 lines (+2/-2)
1 file modified
hr_recruitment/hr_recruitment.py (+2/-2)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.0-opw-573199-ksa
Reviewer Review Type Date Requested Status
Rifakat Husen (OpenERP) (community) Approve
Naresh(OpenERP) Pending
Review via email: mp+100100@code.launchpad.net

Description of the change

Hello,

Fix the problem when stage id is not in the list.

Thanks
KSA

To post a comment you must log in.
Revision history for this message
Rifakat Husen (OpenERP) (rha-openerp) :
review: Approve

Unmerged revisions

5174. By Kirti Savalia(OpenERP)

[FIX]: when stage id is not in the list

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hr_recruitment/hr_recruitment.py'
2--- hr_recruitment/hr_recruitment.py 2011-10-05 15:04:13 +0000
3+++ hr_recruitment/hr_recruitment.py 2012-03-30 11:01:21 +0000
4@@ -198,7 +198,7 @@
5 department = (case.department_id.id or False)
6 st = case.stage_id.id or False
7 stage_ids = stage_obj.search(cr, uid, ['|',('department_id','=',department),('department_id','=',False)], context=context)
8- if st and stage_ids.index(st):
9+ if st in stage_ids and stage_ids.index(st):
10 self.write(cr, uid, [case.id], {'stage_id': stage_ids[stage_ids.index(st)-1]}, context=context)
11 return True
12
13@@ -215,7 +215,7 @@
14 department = (case.department_id.id or False)
15 st = case.stage_id.id or False
16 stage_ids = stage_obj.search(cr, uid, ['|',('department_id','=',department),('department_id','=',False)], context=context)
17- if st and len(stage_ids) != stage_ids.index(st)+1:
18+ if st in stage_ids and len(stage_ids) != stage_ids.index(st)+1:
19 self.write(cr, uid, [case.id], {'stage_id': stage_ids[stage_ids.index(st)+1]}, context=context)
20 return True
21