From 3912beff314c8d55f48a44c946e6a625f78a6a8d Mon Sep 17 00:00:00 2001
From: Kinjal Mehta
Date: Wed, 29 Jun 2016 10:59:44 +0530
Subject: [PATCH] [MOVE] hr_recruitment_survey: Make a bridge module with
survey related code
==============
Specifications
==============
Add an option in the settings to use the surveys or not
By default : do not use interview forms.
If the option is false : on the job application, hide the Interview form field
---
addons/hr_recruitment/README.md | 7 -
addons/hr_recruitment/__openerp__.py | 6 +-
.../data/hr_recruitment_data.xml | 6 +-
.../data/hr_recruitment_demo.xml | 13 +-
.../data/survey_survey_data.xml | 229 ------------------
addons/hr_recruitment/models/hr_job.py | 7 -
.../hr_recruitment/models/hr_recruitment.py | 23 --
.../models/hr_recruitment_config_settings.py | 5 +
.../security/hr_recruitment_security.xml | 4 -
.../security/ir.model.access.csv | 1 -
.../test/recruitment_process.yml | 7 -
addons/hr_recruitment/views/hr_job_views.xml | 15 +-
.../hr_recruitment_config_settings_views.xml | 1 +
.../views/hr_recruitment_views.xml | 33 ---
addons/hr_recruitment_survey/README.md | 6 +
addons/hr_recruitment_survey/__init__.py | 3 +
addons/hr_recruitment_survey/__openerp__.py | 25 ++
.../data/hr_job_demo.xml | 29 +++
.../data/survey_survey_data.xml | 227 +++++++++++++++++
.../hr_recruitment_survey/models/__init__.py | 4 +
.../models/hr_applicant.py | 32 +++
addons/hr_recruitment_survey/models/hr_job.py | 15 ++
.../hr_recruitment_survey_security.xml | 8 +
.../security/ir.model.access.csv | 2 +
.../test/recruitment_process.yml | 5 +
.../views/hr_applicant_views.xml | 62 +++++
.../views/hr_job_views.xml | 40 +++
27 files changed, 472 insertions(+), 343 deletions(-)
delete mode 100644 addons/hr_recruitment/data/survey_survey_data.xml
create mode 100644 addons/hr_recruitment_survey/README.md
create mode 100644 addons/hr_recruitment_survey/__init__.py
create mode 100644 addons/hr_recruitment_survey/__openerp__.py
create mode 100644 addons/hr_recruitment_survey/data/hr_job_demo.xml
create mode 100644 addons/hr_recruitment_survey/data/survey_survey_data.xml
create mode 100644 addons/hr_recruitment_survey/models/__init__.py
create mode 100644 addons/hr_recruitment_survey/models/hr_applicant.py
create mode 100644 addons/hr_recruitment_survey/models/hr_job.py
create mode 100644 addons/hr_recruitment_survey/security/hr_recruitment_survey_security.xml
create mode 100644 addons/hr_recruitment_survey/security/ir.model.access.csv
create mode 100644 addons/hr_recruitment_survey/test/recruitment_process.yml
create mode 100644 addons/hr_recruitment_survey/views/hr_applicant_views.xml
create mode 100644 addons/hr_recruitment_survey/views/hr_job_views.xml
diff --git a/addons/hr_recruitment/README.md b/addons/hr_recruitment/README.md
index ba303cca12f..433a5a8a299 100644
--- a/addons/hr_recruitment/README.md
+++ b/addons/hr_recruitment/README.md
@@ -37,10 +37,3 @@ time by automating some communications with email templates.
Documents like resumes and motivation letters are indexed automatically,
allowing you to easily find for specific skills and build up a database of
profiles.
-
-Integrated Surveys
-------------------
-
-Create your own interview canvas based on our best practices. Use the survey
-designer to adapt questions to your own process. Ask the applicant to fill in
-the survey online, or the interviewer to use it during real interviews.
diff --git a/addons/hr_recruitment/__openerp__.py b/addons/hr_recruitment/__openerp__.py
index 1489c1ef49c..a12cc06ec17 100644
--- a/addons/hr_recruitment/__openerp__.py
+++ b/addons/hr_recruitment/__openerp__.py
@@ -6,21 +6,20 @@
'version': '1.0',
'category': 'Human Resources',
'sequence': 90,
- 'summary': 'Jobs, Recruitment, Applications, Job Interviews, Surveys',
+ 'summary': 'Jobs, Recruitment, Applications, Job Interviews',
'description': """
Manage job positions and the recruitment process
================================================
This application allows you to easily keep track of jobs, vacancies, applications, interviews...
-It is integrated with the mail gateway to automatically fetch email sent to in the list of applications. It's also integrated with the document management system to store and search in the CV base and find the candidate that you are looking for. Similarly, it is integrated with the survey module to allow you to define interviews for different jobs.
+It is integrated with the mail gateway to automatically fetch email sent to in the list of applications. It's also integrated with the document management system to store and search in the CV base and find the candidate that you are looking for. Similarly, it may integrated with the survey module to allow you to define interviews for different jobs.
You can define the different phases of interviews and easily rate the applicant from the kanban view.
""",
'website': 'https://www.odoo.com/page/recruitment',
'depends': [
'decimal_precision',
'hr',
- 'survey',
'calendar',
'fetchmail',
'web_kanban_gauge',
@@ -31,7 +30,6 @@ You can define the different phases of interviews and easily rate the applicant
'data': [
'security/hr_recruitment_security.xml',
'security/ir.model.access.csv',
- 'data/survey_survey_data.xml',
'data/hr_recruitment_data.xml',
'views/hr_recruitment_views.xml',
'report/hr_recruitment_report_views.xml',
diff --git a/addons/hr_recruitment/data/hr_recruitment_data.xml b/addons/hr_recruitment/data/hr_recruitment_data.xml
index 029a8b28951..faf6c6b897c 100644
--- a/addons/hr_recruitment/data/hr_recruitment_data.xml
+++ b/addons/hr_recruitment/data/hr_recruitment_data.xml
@@ -7,9 +7,9 @@
notification
- Recruitment application installed!
- Manage job positions and your company's recruitment process. This application is integrated with the Survey application to help you define interviews for different jobs.
-
Job applications sent by email are automatically integrate in Odoo.
]]>
+ Recruitment Process application installed!
+ Manage job positions and your company's recruitment process. This application may be integrated with the Survey application to help you define interviews for different jobs.
+
Job applications sent by email will automatically be integrated in Odoo.
]]>
diff --git a/addons/hr_recruitment/data/hr_recruitment_demo.xml b/addons/hr_recruitment/data/hr_recruitment_demo.xml
index 138955526ba..81bfdecb589 100644
--- a/addons/hr_recruitment/data/hr_recruitment_demo.xml
+++ b/addons/hr_recruitment/data/hr_recruitment_demo.xml
@@ -25,37 +25,26 @@
-
+
recruit4
-
-
-
-
-
-
- recruit1
- 1recruit
- recruit3
- recruit6
-
diff --git a/addons/hr_recruitment/data/survey_survey_data.xml b/addons/hr_recruitment/data/survey_survey_data.xml
deleted file mode 100644
index 6a5d4142a1c..00000000000
--- a/addons/hr_recruitment/data/survey_survey_data.xml
+++ /dev/null
@@ -1,229 +0,0 @@
-
-
-
-
-
- Recruitment Form
-
-
-
- <p>This form is intended to help the responsible of a recruitment interview.</p>
- <p></p>
-
-
-
- Basic information
-
- 1
- <p></p>
-
-
-
- 1
- From which university will you graduate?
- textbox
-
-
-
- 2
- What is your gender?
- simple_choice
- dropdown
-
-
-
- 1
- Male
-
-
-
- 2
- Female
-
-
-
- 3
- What age group do you belong to?
- simple_choice
- columns
- 4
-
-
-
- 1
- 0-15
-
-
-
- 2
- 16-20
-
-
-
- 3
- 21-30
-
-
-
-
- 4
- 31-40
-
-
-
- 5
- 41-50
-
-
-
- 6
- 51-60
-
-
-
- 7
- 61-70
-
-
-
- 8
- 71+
-
-
-
- Education and Activities
-
- 2
- <p></p>
-
-
-
- 1
- Knowledge
- free_text
-
-
-
- 2
- Education
- free_text
-
-
-
- 3
- Experience
- free_text
-
-
-
- 4
- Activities
- free_text
-
-
-
- Importance
-
- 3
- <p></p>
-
-
-
- 1
- Rate the Importance
- matrix
- simple
-
-
-
- 1
- Not important
-
-
-
- 2
- Somewhat important
-
-
-
- 3
- Important
-
-
-
- 4
- Very important
-
-
-
- 5
- Most important
-
-
-
-
- 1
- Good pay
-
-
-
- 2
- Getting on with colleagues
-
-
-
- 3
- Office environment
-
-
-
- 4
- Desk space
-
-
-
- 5
- State of the art technology
-
-
-
- 6
- Office location
-
-
-
- 7
- Good management
-
-
-
- 8
- Freebies such as tea, coffee and stationery
-
-
-
- 9
- Perks such as free parking, gym passes
-
-
-
- 10
- No out of hours working
-
-
-
- 11
- Dress code
-
-
-
- 12
- Regular meetings
-
-
-
- 13
- Good social life
-
-
-
diff --git a/addons/hr_recruitment/models/hr_job.py b/addons/hr_recruitment/models/hr_job.py
index d7ea3e55467..b29e12ea5a3 100644
--- a/addons/hr_recruitment/models/hr_job.py
+++ b/addons/hr_recruitment/models/hr_job.py
@@ -22,9 +22,6 @@ class Job(models.Model):
user_id = fields.Many2one('res.users', "Recruitment Responsible", track_visibility='onchange')
document_ids = fields.One2many('ir.attachment', compute='_compute_document_ids', string="Applications")
documents_count = fields.Integer(compute='_compute_document_ids', string="Documents")
- survey_id = fields.Many2one(
- 'survey.survey', "Interview Form",
- help="Choose an interview form for this job position and you will be able to print/answer this interview from all applicants who apply for this job")
alias_id = fields.Many2one(
'mail.alias', "Alias", ondelete="restrict", required=True,
help="Email alias for this job position. New emails will automatically create new applicants for this job position.")
@@ -73,10 +70,6 @@ class Job(models.Model):
return 'hr_recruitment.mt_job_new'
return super(Job, self)._track_subtype(init_values)
- @api.multi
- def action_print_survey(self):
- return self.survey_id.action_print_survey()
-
@api.multi
def action_get_attachment_tree_view(self):
action = self.env.ref('base.action_attachment').read()[0]
diff --git a/addons/hr_recruitment/models/hr_recruitment.py b/addons/hr_recruitment/models/hr_recruitment.py
index 87e675590ac..9f038f78cd1 100644
--- a/addons/hr_recruitment/models/hr_recruitment.py
+++ b/addons/hr_recruitment/models/hr_recruitment.py
@@ -148,8 +148,6 @@ class Applicant(models.Model):
partner_mobile = fields.Char("Mobile", size=32)
type_id = fields.Many2one('hr.recruitment.degree', "Degree")
department_id = fields.Many2one('hr.department', "Department")
- survey = fields.Many2one('survey.survey', related='job_id.survey_id', string="Survey") # TDE FIXME: rename to survey_id
- response_id = fields.Many2one('survey.user_input', "Response", ondelete="set null", oldname="response")
reference = fields.Char("Referred By")
day_open = fields.Float(compute='_compute_day', string="Days to Open")
day_close = fields.Float(compute='_compute_day', string="Days to Close")
@@ -323,27 +321,6 @@ class Applicant(models.Model):
}
return res
- @api.multi
- def action_start_survey(self):
- self.ensure_one()
- # create a response and link it to this applicant
- if not self.response_id:
- response = self.env['survey.user_input'].create({'survey_id': self.survey.id, 'partner_id': self.partner_id.id})
- self.response_id = response.id
- else:
- response = self.response_id
- # grab the token of the response and start surveying
- return self.survey.with_context(survey_token=response.token).action_start_survey()
-
- @api.multi
- def action_print_survey(self):
- """ If response is available then print this response otherwise print survey form (print template of the survey) """
- self.ensure_one()
- if not self.response_id:
- return self.survey.action_print_survey()
- else:
- response = self.response_id
- return self.survey.with_context(survey_token=response.token).action_print_survey()
@api.multi
def action_get_attachment_tree_view(self):
diff --git a/addons/hr_recruitment/models/hr_recruitment_config_settings.py b/addons/hr_recruitment/models/hr_recruitment_config_settings.py
index b885ed6afff..7e8893a6161 100644
--- a/addons/hr_recruitment/models/hr_recruitment_config_settings.py
+++ b/addons/hr_recruitment/models/hr_recruitment_config_settings.py
@@ -12,3 +12,8 @@ class RecruitmentSettings(models.TransientModel):
(0, "Do not manage CVs and motivation letter"),
(1, 'Allow the automatic indexation of resumes')
], string='Resumes')
+
+ module_hr_recruitment_survey = fields.Selection(selection=[
+ (0, "Do not use interview forms"),
+ (1, "Use interview forms during the recruitment process")
+ ], string='Interview Form')
diff --git a/addons/hr_recruitment/security/hr_recruitment_security.xml b/addons/hr_recruitment/security/hr_recruitment_security.xml
index 2b9f2c64eec..4f0380c94cd 100644
--- a/addons/hr_recruitment/security/hr_recruitment_security.xml
+++ b/addons/hr_recruitment/security/hr_recruitment_security.xml
@@ -9,9 +9,5 @@
['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]
-
-
-
-
diff --git a/addons/hr_recruitment/security/ir.model.access.csv b/addons/hr_recruitment/security/ir.model.access.csv
index 168d71e8469..2d1be8d77f3 100644
--- a/addons/hr_recruitment/security/ir.model.access.csv
+++ b/addons/hr_recruitment/security/ir.model.access.csv
@@ -5,7 +5,6 @@ access_hr_recruitment_stage_user,hr.recruitment.stage.user,model_hr_recruitment_
access_hr_recruitment_stage_manager,hr.recruitment.stage.manager,model_hr_recruitment_stage,base.group_hr_manager,1,1,1,1
access_hr_recruitment_degree,hr.recruitment.degree,model_hr_recruitment_degree,base.group_hr_user,1,1,1,1
access_res_partner_hr_user,res.partner.user,base.model_res_partner,base.group_hr_user,1,1,1,1
-access_survey_hr_user,survey.hr.user,survey.model_survey_survey,base.group_hr_user,1,1,1,0
access_calendar_event_hruser,calendar.event.hruser,calendar.model_calendar_event,base.group_hr_user,1,1,1,1
access_hr_recruitment_source_hr_officer,hr.recruitment.source,model_hr_recruitment_source,base.group_hr_user,1,1,1,1
access_hr_recruitment_source_all,hr.recruitment.source,model_hr_recruitment_source,,1,0,0,0
diff --git a/addons/hr_recruitment/test/recruitment_process.yml b/addons/hr_recruitment/test/recruitment_process.yml
index 142c10e4be2..19ec05f5891 100644
--- a/addons/hr_recruitment/test/recruitment_process.yml
+++ b/addons/hr_recruitment/test/recruitment_process.yml
@@ -47,10 +47,3 @@
-
!python {model: hr.applicant, id: hr_case_programmer}: |
self.action_makeMeeting()
--
- I print Applicant fill up the interview quetion
--
- !python {model: hr.applicant, id: False}: |
- context = self.env.context.copy()
- context.update({'active_model': 'hr.applicant', 'active_ids': [ref("hr_recruitment.hr_case_programmer")], 'active_id': ref("hr_recruitment.hr_case_programmer")})
- self.browse(ref('hr_case_programmer')).with_context(context).action_print_survey()
diff --git a/addons/hr_recruitment/views/hr_job_views.xml b/addons/hr_recruitment/views/hr_job_views.xml
index 74c2b6419e9..c2f7edf6ec7 100644
--- a/addons/hr_recruitment/views/hr_job_views.xml
+++ b/addons/hr_recruitment/views/hr_job_views.xml
@@ -22,7 +22,6 @@
-
@@ -57,13 +56,7 @@
-