Kirti Savalia(OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/6.1-opw-573199-ksa into 
lp:openobject-addons/6.1.

Requested reviews:
  Naresh(OpenERP) (nch-openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-573199-ksa/+merge/100101

Hello,

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

Thanks
KSA
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-573199-ksa/+merge/100101
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/6.1-opw-573199-ksa.
=== modified file 'hr_recruitment/hr_recruitment.py'
--- hr_recruitment/hr_recruitment.py	2011-12-31 07:57:20 +0000
+++ hr_recruitment/hr_recruitment.py	2012-03-30 11:01:22 +0000
@@ -243,7 +243,7 @@
             department = (case.department_id.id or False)
             st = case.stage_id.id  or False
             stage_ids = stage_obj.search(cr, uid, ['|',('department_id','=',department),('department_id','=',False)], context=context)
-            if st and stage_ids.index(st):
+            if st in stage_ids and stage_ids.index(st):
                 self.write(cr, uid, [case.id], {'stage_id': stage_ids[stage_ids.index(st)-1]}, context=context)
             else:
                 self.write(cr, uid, [case.id], {'stage_id': False}, context=context)
@@ -263,7 +263,7 @@
             st = case.stage_id.id  or False
             stage_ids = stage_obj.search(cr, uid, ['|',('department_id','=',department),('department_id','=',False)], context=context)
             val = False
-            if st and len(stage_ids) != stage_ids.index(st)+1:
+            if st in stage_ids and len(stage_ids) != stage_ids.index(st)+1:
                 val = stage_ids[stage_ids.index(st)+1]
             elif (not st) and stage_ids:
                 val = stage_ids[0]

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to