Merge lp:~openerp-dev/openobject-addons/trunk-bug-727900-ara into lp:openobject-addons

Proposed by Ashvin Rathod (OpenERP)
Status: Merged
Merged at revision: 4510
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-727900-ara
Merge into: lp:openobject-addons
Diff against target: 31 lines (+9/-1)
2 files modified
hr_recruitment/hr_recruitment.py (+8/-0)
hr_recruitment/hr_recruitment_view.xml (+1/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-727900-ara
Reviewer Review Type Date Requested Status
Mustufa Rangwala (Open ERP) (community) Approve
Ashvin Rathod (OpenERP) (community) Needs Resubmitting
Review via email: mp+52170@code.launchpad.net

Description of the change

Hello,

Fix the bug: can not change stage in hr recruitment
https://bugs.launchpad.net/openobject-addons/+bug/727900

Thanks,
ara

To post a comment you must log in.
Revision history for this message
Mustufa Rangwala (Open ERP) (mra-tinyerp) wrote :

you can use:

if not department_id:
   return {'value': {'stage_id': False}}

at the begining of the onchange method so that it will not make unnecessary pool.

review: Needs Fixing
Revision history for this message
Ashvin Rathod (OpenERP) (ara-tinyerp) wrote :

hello,

I have changed as you describe above.

Thanks,
ara

review: Needs Resubmitting
Revision history for this message
Mustufa Rangwala (Open ERP) (mra-tinyerp) :
review: Approve

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-02-17 05:18:59 +0000
3+++ hr_recruitment/hr_recruitment.py 2011-03-04 07:27:19 +0000
4@@ -185,6 +185,14 @@
5 return {'value': result}
6 return {'value': {'department_id': False}}
7
8+ def onchange_department_id(self, cr, uid, ids, department_id=False, context=None):
9+ if not department_id:
10+ return {'value': {'stage_id': False}}
11+ obj_recru_stage = self.pool.get('hr.recruitment.stage')
12+ stage_ids = obj_recru_stage.search(cr, uid, ['|',('department_id','=',department_id),('department_id','=',False)], context=context)
13+ stage_id = stage_ids and stage_ids[0] or False
14+ return {'value': {'stage_id': stage_id}}
15+
16 def stage_previous(self, cr, uid, ids, context=None):
17 """This function computes previous stage for case from its current stage
18 using available stage for that case type
19
20=== modified file 'hr_recruitment/hr_recruitment_view.xml'
21--- hr_recruitment/hr_recruitment_view.xml 2011-01-14 00:11:01 +0000
22+++ hr_recruitment/hr_recruitment_view.xml 2011-03-04 07:27:19 +0000
23@@ -80,7 +80,7 @@
24 <button string="Phone Call" name="%(action_hr_recruitment_phonecall)d" icon="terp-call-start" type="action" groups="base.group_extended"/>
25 <button name="action_makeMeeting" type="object" string="Meeting" icon="gtk-index"/>
26 <newline/>
27- <field name="department_id" widget="selection"/>
28+ <field name="department_id" widget="selection" on_change="onchange_department_id(department_id)"/>
29 <group colspan="2" col="4">
30 <field name="stage_id" domain="[('department_id','=',department_id)]"/>
31 <button name="stage_previous" string="" type="object" icon="gtk-go-back"/>

Subscribers

People subscribed via source and target branches

to all changes: