From ce8239440a49b853907b3fd6c0ccc8bee40af226 Mon Sep 17 00:00:00 2001 From: "Atik Agewan (OpenERP)" Date: Fri, 9 Dec 2011 15:21:02 +0530 Subject: [PATCH 1/8] [IMP]: stage_previous, stage_next,case_reset Cover in Test case bzr revid: aag@tinyerp.com-20111209095102-3wgjy7v66y58a7eg --- .../test/recruitment_process.yml | 41 +++++++++++++++---- 1 file changed, 34 insertions(+), 7 deletions(-) diff --git a/addons/hr_recruitment/test/recruitment_process.yml b/addons/hr_recruitment/test/recruitment_process.yml index 43575137a6e..565b67168b6 100644 --- a/addons/hr_recruitment/test/recruitment_process.yml +++ b/addons/hr_recruitment/test/recruitment_process.yml @@ -19,17 +19,23 @@ assert applicant.name == "Application for the post of Jr.application Programmer.", "Subject does not match" assert applicant.state == "draft" assert len(resume_ids), "Resume does not attached." + +- + I Refuse applicant for the Recruitment. +- + !python {model: hr.applicant}: | + self.case_close(cr, uid, [ref("hr_case_programmer")]) +- + I open applicant for the Recruitment. +- + !python {model: hr.applicant}: | + self.case_reset(cr, uid, [ref("hr_case_programmer")]) + self.case_open(cr, uid, [ref("hr_case_programmer")]) - I assign the Job position to the applicant - !python {model: hr.applicant}: | self.write(cr, uid, [ref('hr_case_programmer')], {'job_id':ref('hr.job_jr_appli')}) -- - I open applicant for the Recruitment -- - - !python {model: hr.applicant}: | - self.case_open(cr, uid, [ref("hr_case_programmer")]) - I start communication with applicant, first schedule phonecall. - @@ -40,6 +46,21 @@ - !python {model: hr.applicant}: | self.action_makeMeeting(cr, uid, [ref('hr_case_programmer')]) +- + I check Initial Qualification of applicant. +- + !python {model: hr.applicant}: | + self.stage_next(cr, uid, [ref('hr_case_programmer')]) +- + I schedule First Interview of applicant. +- + !python {model: hr.applicant}: | + self.stage_next(cr, uid, [ref('hr_case_programmer')]) +- + On a successful First Interview of applicant, I schedule Second Interview. +- + !python {model: hr.applicant}: | + self.stage_next(cr, uid, [ref('hr_case_programmer')]) - Applicant fillup the answer of the interview quetion. - @@ -56,7 +77,13 @@ !python {model: hr.applicant}: | self.action_print_survey(cr, uid, [ref('hr_case_programmer')]) - - On a successful interview with the applicant, I hired employee. + On a successful Second Interview of applicant Contract is Proposed to applicant. +- + !python {model: hr.applicant}: | + self.stage_next(cr, uid, [ref('hr_case_programmer')]) + self.stage_previous(cr, uid, [ref('hr_case_programmer')]) +- + I Hired employee. - !python {model: hr.applicant}: | self.case_close_with_emp(cr, uid, [ref('hr_case_programmer')]) From d4299ee9f086d46259147e0ab21438fbcf59e58f Mon Sep 17 00:00:00 2001 From: "Atik Agewan (OpenERP)" Date: Fri, 9 Dec 2011 15:55:28 +0530 Subject: [PATCH 2/8] [IMP]: Dead Code bzr revid: aag@tinyerp.com-20111209102528-c9o6vse1mcfp1m14 --- addons/hr_recruitment/hr_recruitment.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/hr_recruitment/hr_recruitment.py b/addons/hr_recruitment/hr_recruitment.py index 8730d1fbf32..0acf41c5601 100644 --- a/addons/hr_recruitment/hr_recruitment.py +++ b/addons/hr_recruitment/hr_recruitment.py @@ -183,7 +183,7 @@ class hr_applicant(crm.crm_case, osv.osv): 'color': fields.integer('Color Index'), 'user_email': fields.related('user_id', 'user_email', type='char', string='User Email', readonly=True), } - + # Dead Code def _get_stage(self, cr, uid, context=None): ids = self.pool.get('hr.recruitment.stage').search(cr, uid, [], context=context) return ids and ids[0] or False @@ -365,6 +365,7 @@ class hr_applicant(crm.crm_case, osv.osv): self.write(cr, uid, [res_id], vals, context) return res_id + # Dead Code def message_update(self, cr, uid, ids, msg, vals={}, default_act='pending', context=None): if isinstance(ids, (str, int, long)): ids = [ids] From 5d15bf071f31f9fd2ea6c7dc6d633d5c8d5ff31f Mon Sep 17 00:00:00 2001 From: "Atik Agewan (OpenERP)" Date: Fri, 9 Dec 2011 16:25:22 +0530 Subject: [PATCH 3/8] [IMP]: I create Employee ==> partner bzr revid: aag@tinyerp.com-20111209105522-1wsw36413e2ym9qk --- addons/hr_recruitment/test/recruitment_process.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/addons/hr_recruitment/test/recruitment_process.yml b/addons/hr_recruitment/test/recruitment_process.yml index 565b67168b6..010754bc55d 100644 --- a/addons/hr_recruitment/test/recruitment_process.yml +++ b/addons/hr_recruitment/test/recruitment_process.yml @@ -87,8 +87,17 @@ - !python {model: hr.applicant}: | self.case_close_with_emp(cr, uid, [ref('hr_case_programmer')]) + context.update({'active_model': 'hr.applicant', 'active_ids': [ref("hr_recruitment.hr_case_programmer")], 'active_id': ref("hr_recruitment.hr_case_programmer")}) - I check that applicant is "Hired". - !assert {model: hr.applicant, id: hr_case_programmer}: - state == 'done' +- + Now Hired Employee want to be a Partner of Company. +- + !record {model: hr.recruitment.partner.create, id: hr_recruitment_partner_id1 }: +- + !python {model: hr.recruitment.partner.create}: | + context.update({'active_model': 'hr.applicant', 'active_ids': [ref("hr_recruitment.hr_case_programmer")], 'active_id': ref("hr_recruitment.hr_case_programmer")}) + self.make_order(cr, uid, [ref("hr_recruitment_partner_id1")], context=context) From 1992ad3a3f0b88cd5381a93be8210eaeea4012b9 Mon Sep 17 00:00:00 2001 From: "Atik Agewan (OpenERP)" Date: Fri, 9 Dec 2011 17:08:32 +0530 Subject: [PATCH 4/8] [IMP]: hr_recruitment:Test func of hr_recruitment_employee_hired bzr revid: aag@tinyerp.com-20111209113832-ji33od2ert7n90pc --- .../test/recruitment_process.yml | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/addons/hr_recruitment/test/recruitment_process.yml b/addons/hr_recruitment/test/recruitment_process.yml index 010754bc55d..e1d6133d036 100644 --- a/addons/hr_recruitment/test/recruitment_process.yml +++ b/addons/hr_recruitment/test/recruitment_process.yml @@ -19,7 +19,6 @@ assert applicant.name == "Application for the post of Jr.application Programmer.", "Subject does not match" assert applicant.state == "draft" assert len(resume_ids), "Resume does not attached." - - I Refuse applicant for the Recruitment. - @@ -83,7 +82,7 @@ self.stage_next(cr, uid, [ref('hr_case_programmer')]) self.stage_previous(cr, uid, [ref('hr_case_programmer')]) - - I Hired employee. + I Hired Applicant. - !python {model: hr.applicant}: | self.case_close_with_emp(cr, uid, [ref('hr_case_programmer')]) @@ -93,6 +92,25 @@ - !assert {model: hr.applicant, id: hr_case_programmer}: - state == 'done' +- + I Not give Employeement to Hired Aplicant till. +- + !python {model: hired.employee}: | + context.update({'active_model': 'hr.applicant', 'active_ids': [ref("hr_recruitment.hr_case_programmer")], 'active_id': ref("hr_recruitment.hr_case_programmer")}) + emp_id = self.create(cr, uid, {}, context=context) + self.case_close(cr, uid, [emp_id], context=context) +- + Now I give Employeement to Hired Applicant . +- + !python {model: hr.applicant}: | + self.case_reset(cr, uid, [ref("hr_case_programmer")]) + self.case_open(cr, uid, [ref("hr_case_programmer")]) + context.update({'active_model': 'hr.applicant', 'active_ids': [ref("hr_recruitment.hr_case_programmer")], 'active_id': ref("hr_recruitment.hr_case_programmer")}) +- + !python {model: hired.employee}: | + context.update({'active_model': 'hr.applicant', 'active_ids': [ref("hr_recruitment.hr_case_programmer")], 'active_id': ref("hr_recruitment.hr_case_programmer")}) + emp_hr_id = self.create(cr, uid, {}, context=context) + self.case_close_with_emp(cr, uid, [emp_hr_id], context=context) - Now Hired Employee want to be a Partner of Company. - From 0b1365cbfd67a7dfd63cfd1a901b6a997e6d31d3 Mon Sep 17 00:00:00 2001 From: "Atik Agewan (OpenERP)" Date: Fri, 9 Dec 2011 17:38:25 +0530 Subject: [PATCH 5/8] [IMP]: hr_recruitment:Test func of hr.recruitment.job2phonecall wizards bzr revid: aag@tinyerp.com-20111209120825-sqkpwjubtr08w1ee --- addons/hr_recruitment/test/recruitment_process.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/hr_recruitment/test/recruitment_process.yml b/addons/hr_recruitment/test/recruitment_process.yml index e1d6133d036..d87f21c5f24 100644 --- a/addons/hr_recruitment/test/recruitment_process.yml +++ b/addons/hr_recruitment/test/recruitment_process.yml @@ -34,12 +34,16 @@ I assign the Job position to the applicant - !python {model: hr.applicant}: | + context.update({'active_model': 'hr.applicant', 'active_id': ref("hr_case_programmer"), 'active_ids': [ref("hr_case_programmer")], 'survey_id': ref("survey_job_0")}) self.write(cr, uid, [ref('hr_case_programmer')], {'job_id':ref('hr.job_jr_appli')}) - I start communication with applicant, first schedule phonecall. +- + !record {model: hr.recruitment.job2phonecall, id: hr_recruitment_job2phonecall_id1 }: - !python {model: hr.recruitment.job2phonecall}: | - self.make_phonecall(cr, uid, [ref('hr_case_programmer')]) + context.update({'active_model': 'hr.applicant', 'active_id': ref("hr_case_programmer"), 'active_ids': [ref("hr_case_programmer")], 'survey_id': ref("survey_job_0")}) + self.make_phonecall(cr, uid, [ref('hr_recruitment_job2phonecall_id1')], context=context) - I schedule meeting with applicant for interview. - From 2863869b60980e8dc9b1bf21676c2752f5fa5db4 Mon Sep 17 00:00:00 2001 From: "Atik Agewan (OpenERP)" Date: Wed, 14 Dec 2011 15:07:45 +0530 Subject: [PATCH 6/8] [IMP]: hr_recruitment:optimize code of yml bzr revid: aag@tinyerp.com-20111214093745-rmyqn9qhut07xfne --- addons/hr_recruitment/test/recruitment_process.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/addons/hr_recruitment/test/recruitment_process.yml b/addons/hr_recruitment/test/recruitment_process.yml index d87f21c5f24..1bf0e24a650 100644 --- a/addons/hr_recruitment/test/recruitment_process.yml +++ b/addons/hr_recruitment/test/recruitment_process.yml @@ -38,12 +38,11 @@ self.write(cr, uid, [ref('hr_case_programmer')], {'job_id':ref('hr.job_jr_appli')}) - I start communication with applicant, first schedule phonecall. -- - !record {model: hr.recruitment.job2phonecall, id: hr_recruitment_job2phonecall_id1 }: - !python {model: hr.recruitment.job2phonecall}: | context.update({'active_model': 'hr.applicant', 'active_id': ref("hr_case_programmer"), 'active_ids': [ref("hr_case_programmer")], 'survey_id': ref("survey_job_0")}) - self.make_phonecall(cr, uid, [ref('hr_recruitment_job2phonecall_id1')], context=context) + id = self.create(cr, uid, {}, context=context) + self.make_phonecall(cr, uid, [id], context=context) - I schedule meeting with applicant for interview. - From 0a86b7abbf2060de08b09cb7b89df9b5a6adeb55 Mon Sep 17 00:00:00 2001 From: "Atik Agewan (OpenERP)" Date: Wed, 14 Dec 2011 15:47:28 +0530 Subject: [PATCH 7/8] [IMP]: hr_recruitment:optimize code of yml bzr revid: aag@tinyerp.com-20111214101728-pmxerksloz1972p9 --- addons/hr_recruitment/hr_recruitment.py | 1 - .../test/recruitment_process.yml | 18 +++++++----------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/addons/hr_recruitment/hr_recruitment.py b/addons/hr_recruitment/hr_recruitment.py index baa5a761899..8594c565acb 100644 --- a/addons/hr_recruitment/hr_recruitment.py +++ b/addons/hr_recruitment/hr_recruitment.py @@ -365,7 +365,6 @@ class hr_applicant(crm.crm_case, osv.osv): self.write(cr, uid, [res_id], vals, context) return res_id - # Dead Code def message_update(self, cr, uid, ids, msg, vals={}, default_act='pending', context=None): if isinstance(ids, (str, int, long)): ids = [ids] diff --git a/addons/hr_recruitment/test/recruitment_process.yml b/addons/hr_recruitment/test/recruitment_process.yml index 1bf0e24a650..c1ef5022209 100644 --- a/addons/hr_recruitment/test/recruitment_process.yml +++ b/addons/hr_recruitment/test/recruitment_process.yml @@ -20,7 +20,7 @@ assert applicant.state == "draft" assert len(resume_ids), "Resume does not attached." - - I Refuse applicant for the Recruitment. + I refuse applicant for the Recruitment. - !python {model: hr.applicant}: | self.case_close(cr, uid, [ref("hr_case_programmer")]) @@ -34,7 +34,6 @@ I assign the Job position to the applicant - !python {model: hr.applicant}: | - context.update({'active_model': 'hr.applicant', 'active_id': ref("hr_case_programmer"), 'active_ids': [ref("hr_case_programmer")], 'survey_id': ref("survey_job_0")}) self.write(cr, uid, [ref('hr_case_programmer')], {'job_id':ref('hr.job_jr_appli')}) - I start communication with applicant, first schedule phonecall. @@ -89,33 +88,30 @@ - !python {model: hr.applicant}: | self.case_close_with_emp(cr, uid, [ref('hr_case_programmer')]) - context.update({'active_model': 'hr.applicant', 'active_ids': [ref("hr_recruitment.hr_case_programmer")], 'active_id': ref("hr_recruitment.hr_case_programmer")}) - I check that applicant is "Hired". - !assert {model: hr.applicant, id: hr_case_programmer}: - state == 'done' - - I Not give Employeement to Hired Aplicant till. + I do not give employment to the hired the applicant. - !python {model: hired.employee}: | context.update({'active_model': 'hr.applicant', 'active_ids': [ref("hr_recruitment.hr_case_programmer")], 'active_id': ref("hr_recruitment.hr_case_programmer")}) emp_id = self.create(cr, uid, {}, context=context) self.case_close(cr, uid, [emp_id], context=context) - - Now I give Employeement to Hired Applicant . + Now I give employment to hired applicant . - !python {model: hr.applicant}: | + hired_emp_obj = self.pool.get('hired.employee') self.case_reset(cr, uid, [ref("hr_case_programmer")]) self.case_open(cr, uid, [ref("hr_case_programmer")]) context.update({'active_model': 'hr.applicant', 'active_ids': [ref("hr_recruitment.hr_case_programmer")], 'active_id': ref("hr_recruitment.hr_case_programmer")}) + emp_hr_id = hired_emp_obj.create(cr, uid, {}, context=context) + hired_emp_obj.case_close_with_emp(cr, uid, [emp_hr_id], context=context) - - !python {model: hired.employee}: | - context.update({'active_model': 'hr.applicant', 'active_ids': [ref("hr_recruitment.hr_case_programmer")], 'active_id': ref("hr_recruitment.hr_case_programmer")}) - emp_hr_id = self.create(cr, uid, {}, context=context) - self.case_close_with_emp(cr, uid, [emp_hr_id], context=context) -- - Now Hired Employee want to be a Partner of Company. + Now hired employee want to be a partner of company. - !record {model: hr.recruitment.partner.create, id: hr_recruitment_partner_id1 }: - From 337fd9d81e42615711facfaeda9001ee52446ba1 Mon Sep 17 00:00:00 2001 From: "Atik Agewan (OpenERP)" Date: Wed, 14 Dec 2011 16:56:47 +0530 Subject: [PATCH 8/8] [IMP]: hr_recruitment:remove changes of message_update bzr revid: aag@tinyerp.com-20111214112647-mv855r130x1om8zb --- addons/hr_recruitment/hr_recruitment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_recruitment/hr_recruitment.py b/addons/hr_recruitment/hr_recruitment.py index 8594c565acb..625b69a0b02 100644 --- a/addons/hr_recruitment/hr_recruitment.py +++ b/addons/hr_recruitment/hr_recruitment.py @@ -365,7 +365,7 @@ class hr_applicant(crm.crm_case, osv.osv): self.write(cr, uid, [res_id], vals, context) return res_id - def message_update(self, cr, uid, ids, msg, vals={}, default_act='pending', context=None): + def message_update(self, cr, uid, ids, msg, vals=None, default_act='pending', context=None): if isinstance(ids, (str, int, long)): ids = [ids] if vals is None: