From a8a6729eed07d5f34f5250088552f45025f6d85c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Wed, 19 Dec 2018 12:22:53 +0000 Subject: [PATCH] [IMP] hr_recruitment_survey: add recruitment survey category Purpose of this commit is to add a new survey category for applicants. That way surveys created and/or used through recruitment process are correctly set in their own category allowing to filter them. When creating a new recruitment only surveys linked to recruitment process are shown. Moreover default values are propagated when creating new surveys so that they are correctly configured by default as recruitment and invite-only surveys. This commit is linked to task ID 1911586 and PR #28986. --- addons/hr_recruitment_survey/__manifest__.py | 1 + addons/hr_recruitment_survey/data/survey_demo.xml | 1 + addons/hr_recruitment_survey/models/__init__.py | 2 ++ addons/hr_recruitment_survey/models/hr_job.py | 1 + .../hr_recruitment_survey/models/survey_survey.py | 9 +++++++++ addons/hr_recruitment_survey/views/hr_job_views.xml | 7 ++++--- .../views/survey_survey_views.xml | 13 +++++++++++++ 7 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 addons/hr_recruitment_survey/models/survey_survey.py create mode 100644 addons/hr_recruitment_survey/views/survey_survey_views.xml diff --git a/addons/hr_recruitment_survey/__manifest__.py b/addons/hr_recruitment_survey/__manifest__.py index b3228699f0e..6d04b788b10 100644 --- a/addons/hr_recruitment_survey/__manifest__.py +++ b/addons/hr_recruitment_survey/__manifest__.py @@ -14,6 +14,7 @@ 'security/hr_recruitment_survey_security.xml', 'views/hr_job_views.xml', 'views/hr_applicant_views.xml', + 'views/survey_survey_views.xml', 'views/res_config_setting_views.xml', ], 'demo': [ diff --git a/addons/hr_recruitment_survey/data/survey_demo.xml b/addons/hr_recruitment_survey/data/survey_demo.xml index 2f98596d8db..f7480ec6d6b 100644 --- a/addons/hr_recruitment_survey/data/survey_demo.xml +++ b/addons/hr_recruitment_survey/data/survey_demo.xml @@ -4,6 +4,7 @@ Recruitment Form token + hr_recruitment

diff --git a/addons/hr_recruitment_survey/models/__init__.py b/addons/hr_recruitment_survey/models/__init__.py index 3d3ce8e9b0b..dc295255d0c 100644 --- a/addons/hr_recruitment_survey/models/__init__.py +++ b/addons/hr_recruitment_survey/models/__init__.py @@ -1,4 +1,6 @@ # -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. from . import hr_job from . import hr_applicant +from . import survey_survey diff --git a/addons/hr_recruitment_survey/models/hr_job.py b/addons/hr_recruitment_survey/models/hr_job.py index 9f424d34b52..eb24574e55a 100644 --- a/addons/hr_recruitment_survey/models/hr_job.py +++ b/addons/hr_recruitment_survey/models/hr_job.py @@ -8,6 +8,7 @@ class Job(models.Model): survey_id = fields.Many2one( 'survey.survey', "Interview Form", + domain=[('category', '=', 'hr_recruitment')], 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") @api.multi diff --git a/addons/hr_recruitment_survey/models/survey_survey.py b/addons/hr_recruitment_survey/models/survey_survey.py new file mode 100644 index 00000000000..21674e84ee6 --- /dev/null +++ b/addons/hr_recruitment_survey/models/survey_survey.py @@ -0,0 +1,9 @@ +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from odoo import fields, models + + +class Survey(models.Model): + _inherit = 'survey.survey' + + category = fields.Selection(selection_add=[('hr_recruitment', 'Recruitment')]) diff --git a/addons/hr_recruitment_survey/views/hr_job_views.xml b/addons/hr_recruitment_survey/views/hr_job_views.xml index 1cab317718c..7223f1c6834 100644 --- a/addons/hr_recruitment_survey/views/hr_job_views.xml +++ b/addons/hr_recruitment_survey/views/hr_job_views.xml @@ -6,9 +6,10 @@ -

- +