[FIX] adaptation of hr_recruitment module to the new version of survey

bzr revid: rim@openerp.com-20140207162615-n8txh4ymlipatbwl
This commit is contained in:
Richard Mathot (OpenERP) 2014-02-07 17:26:15 +01:00
parent 206e4cbeb5
commit b650340a29
9 changed files with 67 additions and 434 deletions

View File

@ -37,7 +37,8 @@ You can define the different phases of interviews and easily rate the applicant
""",
'author': 'OpenERP SA',
'website': 'http://www.openerp.com',
'images': ['images/hr_recruitment_analysis.jpeg','images/hr_recruitment_applicants.jpeg'],
'images': ['images/hr_recruitment_analysis.jpeg',
'images/hr_recruitment_applicants.jpeg'],
'depends': [
'decimal_precision',
'hr',
@ -55,6 +56,7 @@ You can define the different phases of interviews and easily rate the applicant
'board_hr_recruitment_statistical_view.xml',
'hr_recruitment_installer_view.xml',
'res_config_view.xml',
'survey_data_recruitment.xml',
'hr_recruitment_data.xml',
],
'demo': ['hr_recruitment_demo.xml'],

View File

@ -213,8 +213,8 @@ class hr_applicant(osv.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.related('job_id', 'survey_id', type='many2one', relation='survey', string='Survey'),
'response': fields.integer("Response"),
'survey': fields.related('job_id', 'survey_id', type='many2one', relation='survey.survey', string='Survey'),
'response_id': fields.many2one('survey.user_input', "Response", ondelete='set null', oldname="response"),
'reference': fields.char('Referred By', size=128),
'source_id': fields.many2one('hr.recruitment.source', 'Source'),
'day_open': fields.function(_compute_day, string='Days to Open', \
@ -312,24 +312,34 @@ class hr_applicant(osv.Model):
}
return res
def action_print_survey(self, cr, uid, ids, context=None):
"""
If response is available then print this response otherwise print survey form(print template of the survey).
def action_start_survey(self, cr, uid, ids, context=None):
context = context if context else {}
applicant = self.browse(cr, uid, ids, context=context)[0]
survey_obj = self.pool.get('survey.survey')
response_obj = self.pool.get('survey.user_input')
# create a response and link it to this applicant
if not applicant.response_id:
response_id = response_obj.create(cr, uid, {'survey_id': applicant.survey.id, 'partner_id': applicant.partner_id.id}, context=context)
self.write(cr, uid, ids[0], {'response_id': response_id}, context=context)
else:
response_id = applicant.response_id.id
# grab the token of the response and start surveying
response = response_obj.browse(cr, uid, response_id, context=context)
context.update({'survey_token': response.token})
return survey_obj.action_start_survey(cr, uid, [applicant.survey.id], context=context)
@param self: The object pointer
@param cr: the current row, from the database cursor,
@param uid: the current users ID for security checks,
@param ids: List of Survey IDs
@param context: A standard dictionary for contextual values
@return: Dictionary value for print survey form.
"""
if context is None:
context = {}
record = self.browse(cr, uid, ids, context=context)
record = record and record[0]
context.update({'survey_id': record.survey.id, 'response_id': [record.response], 'response_no': 0, })
value = self.pool.get("survey").action_print_survey(cr, uid, ids, context=context)
return value
def action_print_survey(self, cr, uid, ids, context=None):
""" If response is available then print this response otherwise print survey form (print template of the survey) """
context = context if context else {}
applicant = self.browse(cr, uid, ids, context=context)[0]
survey_obj = self.pool.get('survey.survey')
response_obj = self.pool.get('survey.user_input')
if not applicant.response_id:
return survey_obj.action_print_survey(cr, uid, [applicant.survey.id], context=context)
else:
response = response_obj.browse(cr, uid, applicant.response_id.id, context=context)
context.update({'survey_token': response.token})
return survey_obj.action_print_survey(cr, uid, [applicant.survey.id], context=context)
def action_get_attachment_tree_view(self, cr, uid, ids, context):
domain = ['&', ('res_model', '=', 'hr.applicant'), ('res_id', 'in', ids)]
@ -491,7 +501,7 @@ class hr_job(osv.osv):
_name = "hr.job"
_inherits = {'mail.alias': 'alias_id'}
_columns = {
'survey_id': fields.many2one('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"),
'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."),
@ -525,21 +535,9 @@ class hr_job(osv.osv):
return res
def action_print_survey(self, cr, uid, ids, context=None):
if context is None:
context = {}
datas = {}
record = self.browse(cr, uid, ids, context=context)[0]
if record.survey_id:
datas['ids'] = [record.survey_id.id]
datas['model'] = 'survey.print'
context.update({'response_id': [0], 'response_no': 0})
return {
'type': 'ir.actions.report.xml',
'report_name': 'survey.form',
'datas': datas,
'context': context,
'nodestroy': True,
}
job = self.browse(cr, uid, ids, context=context)[0]
survey_id = job.survey_id.id
return self.pool.get('survey.survey').action_print_survey(cr, uid, [survey_id], context=context)
class applicant_category(osv.osv):

View File

@ -118,379 +118,6 @@
<field name="fold" eval="True"/>
</record>
<record id="survey_job_0" model="survey">
<field name="title">Job Survey</field>
<field name="max_response_limit">20</field>
<field eval="[(6,0,[])]" name="users"/>
<field name="type" ref="survey.survey_type1"/>
<field name="responsible_id" ref="base.user_root"/>
<field name="response_user">5</field>
</record>
<record id="survey_page_job_0" model="survey.page">
<field name="title">Default Section</field>
<field name="survey_id" ref="survey_job_0"/>
<field eval="1" name="sequence"/>
</record>
<record id="survey_page_job_1" model="survey.page">
<field name="title">Education &amp; Activities</field>
<field name="survey_id" ref="survey_job_0"/>
<field eval="2" name="sequence"/>
</record>
<record id="survey_page_job_2" model="survey.page">
<field name="title">Importance</field>
<field name="survey_id" ref="survey_job_0"/>
<field eval="3" name="sequence"/>
</record>
<record id="survey_question_job_0" model="survey.question">
<field name="in_visible_answer_type">1</field>
<field name="validation_type">do_not_validate</field>
<field name="comment_valid_type">do_not_validate</field>
<field name="make_comment_field_err_msg">Please enter a comment.</field>
<field name="numeric_required_sum_err_msg">The choices need to add up to [enter sum here].</field>
<field eval="0" name="comment_column"/>
<field name="validation_valid_err_msg">The comment you entered is in an invalid format.</field>
<field eval="0" name="rating_allow_one_column_require"/>
<field name="req_error_msg">This question requires an answer.</field>
<field eval="1" name="sequence"/>
<field name="question">From which university will you graduate?</field>
<field eval="0" name="is_require_answer"/>
<field name="type">single_textbox</field>
<field name="comment_valid_err_msg">The comment you entered is in an invalid format.</field>
<field eval="0" name="make_comment_field"/>
<field eval="1" name="in_visible_menu_choice"/>
<field name="page_id" ref="survey_page_job_0"/>
<field name="comment_label">Other</field>
<field eval="1" name="in_visible_rating_weight"/>
<field eval="0" name="allow_comment"/>
</record>
<record id="survey_question_job_1" model="survey.question">
<field name="in_visible_answer_type">1</field>
<field name="validation_type">do_not_validate</field>
<field name="comment_valid_type">do_not_validate</field>
<field name="make_comment_field_err_msg">Please enter a comment.</field>
<field name="numeric_required_sum_err_msg">The choices need to add up to [enter sum here].</field>
<field eval="0" name="comment_column"/>
<field name="validation_valid_err_msg">The comment you entered is in an invalid format.</field>
<field eval="0" name="rating_allow_one_column_require"/>
<field name="req_error_msg">This question requires an answer.</field>
<field eval="1" name="sequence"/>
<field name="question">Rate the Importance</field>
<field eval="0" name="is_require_answer"/>
<field name="type">matrix_of_choices_only_one_ans</field>
<field name="comment_valid_err_msg">The comment you entered is in an invalid format.</field>
<field eval="0" name="make_comment_field"/>
<field eval="1" name="in_visible_menu_choice"/>
<field name="page_id" ref="survey_page_job_2"/>
<field name="comment_label">Other</field>
<field eval="1" name="in_visible_rating_weight"/>
<field eval="0" name="allow_comment"/>
</record>
<record id="survey_question_job_2" model="survey.question">
<field name="in_visible_answer_type">1</field>
<field name="validation_type">do_not_validate</field>
<field name="comment_valid_type">do_not_validate</field>
<field name="make_comment_field_err_msg">Please enter a comment.</field>
<field name="numeric_required_sum_err_msg">The choices need to add up to [enter sum here].</field>
<field eval="0" name="comment_column"/>
<field name="validation_valid_err_msg">The comment you entered is in an invalid format.</field>
<field eval="0" name="rating_allow_one_column_require"/>
<field name="req_error_msg">This question requires an answer.</field>
<field eval="1" name="sequence"/>
<field name="question">Education</field>
<field eval="0" name="is_require_answer"/>
<field name="type">comment</field>
<field name="comment_valid_err_msg">The comment you entered is in an invalid format.</field>
<field eval="0" name="make_comment_field"/>
<field eval="1" name="in_visible_menu_choice"/>
<field name="page_id" ref="survey_page_job_1"/>
<field name="comment_label">Other</field>
<field eval="1" name="in_visible_rating_weight"/>
<field eval="0" name="allow_comment"/>
</record>
<record id="survey_question_job_3" model="survey.question">
<field name="in_visible_answer_type">1</field>
<field name="validation_type">do_not_validate</field>
<field name="comment_valid_type">do_not_validate</field>
<field name="make_comment_field_err_msg">Please enter a comment.</field>
<field name="numeric_required_sum_err_msg">The choices need to add up to [enter sum here].</field>
<field eval="0" name="comment_column"/>
<field name="validation_valid_err_msg">The comment you entered is in an invalid format.</field>
<field eval="0" name="rating_allow_one_column_require"/>
<field name="req_error_msg">This question requires an answer.</field>
<field eval="2" name="sequence"/>
<field name="question">Knowledge</field>
<field eval="0" name="is_require_answer"/>
<field name="type">comment</field>
<field name="comment_valid_err_msg">The comment you entered is in an invalid format.</field>
<field eval="0" name="make_comment_field"/>
<field eval="1" name="in_visible_menu_choice"/>
<field name="page_id" ref="survey_page_job_1"/>
<field name="comment_label">Other</field>
<field eval="1" name="in_visible_rating_weight"/>
<field eval="0" name="allow_comment"/>
</record>
<record id="survey_question_job_4" model="survey.question">
<field name="in_visible_answer_type">1</field>
<field name="validation_type">do_not_validate</field>
<field name="comment_valid_type">do_not_validate</field>
<field name="make_comment_field_err_msg">Please enter a comment.</field>
<field name="numeric_required_sum_err_msg">The choices need to add up to [enter sum here].</field>
<field eval="0" name="comment_column"/>
<field name="validation_valid_err_msg">The comment you entered is in an invalid format.</field>
<field eval="0" name="rating_allow_one_column_require"/>
<field name="req_error_msg">This question requires an answer.</field>
<field eval="2" name="sequence"/>
<field name="question">What is your gender?</field>
<field eval="0" name="is_require_answer"/>
<field name="type">multiple_choice_only_one_ans</field>
<field name="comment_valid_err_msg">The comment you entered is in an invalid format.</field>
<field eval="0" name="make_comment_field"/>
<field eval="1" name="in_visible_menu_choice"/>
<field name="page_id" ref="survey_page_job_0"/>
<field name="comment_label">Other</field>
<field eval="1" name="in_visible_rating_weight"/>
<field eval="0" name="allow_comment"/>
</record>
<record id="survey_answer_job_70" model="survey.answer">
<field name="in_visible_answer_type">1</field>
<field name="answer">Male</field>
<field name="question_id" ref="survey_question_job_4"/>
<field eval="1" name="sequence"/>
</record>
<record id="survey_answer_job_71" model="survey.answer">
<field name="in_visible_answer_type">1</field>
<field name="answer">Female</field>
<field name="question_id" ref="survey_question_job_4"/>
<field eval="2" name="sequence"/>
</record>
<record id="survey_question_job_5" model="survey.question">
<field name="in_visible_answer_type">1</field>
<field name="validation_type">do_not_validate</field>
<field name="comment_valid_type">do_not_validate</field>
<field name="make_comment_field_err_msg">Please enter a comment.</field>
<field name="numeric_required_sum_err_msg">The choices need to add up to [enter sum here].</field>
<field eval="0" name="comment_column"/>
<field name="validation_valid_err_msg">The comment you entered is in an invalid format.</field>
<field eval="0" name="rating_allow_one_column_require"/>
<field name="req_error_msg">This question requires an answer.</field>
<field eval="3" name="sequence"/>
<field name="question">What age group do you belong to?</field>
<field eval="0" name="is_require_answer"/>
<field name="type">multiple_choice_only_one_ans</field>
<field name="comment_valid_err_msg">The comment you entered is in an invalid format.</field>
<field eval="0" name="make_comment_field"/>
<field eval="1" name="in_visible_menu_choice"/>
<field name="page_id" ref="survey_page_job_0"/>
<field name="comment_label">Other</field>
<field eval="1" name="in_visible_rating_weight"/>
<field eval="0" name="allow_comment"/>
</record>
<record id="survey_answer_job_81" model="survey.answer">
<field name="in_visible_answer_type">1</field>
<field name="answer">0 - 15</field>
<field name="question_id" ref="survey_question_job_5"/>
<field eval="1" name="sequence"/>
</record>
<record id="survey_answer_job_82" model="survey.answer">
<field name="in_visible_answer_type">1</field>
<field name="answer">16 - 20</field>
<field name="question_id" ref="survey_question_job_5"/>
<field eval="2" name="sequence"/>
</record>
<record id="survey_answer_job_83" model="survey.answer">
<field name="in_visible_answer_type">1</field>
<field name="answer">21 - 30</field>
<field name="question_id" ref="survey_question_job_5"/>
<field eval="3" name="sequence"/>
</record>
<record id="survey_answer_job_84" model="survey.answer">
<field name="in_visible_answer_type">1</field>
<field name="answer">31 - 40</field>
<field name="question_id" ref="survey_question_job_5"/>
<field eval="4" name="sequence"/>
</record>
<record id="survey_answer_job_85" model="survey.answer">
<field name="in_visible_answer_type">1</field>
<field name="answer">41 - 50</field>
<field name="question_id" ref="survey_question_job_5"/>
<field eval="5" name="sequence"/>
</record>
<record id="survey_answer_job_86" model="survey.answer">
<field name="in_visible_answer_type">1</field>
<field name="answer">51 - 60</field>
<field name="question_id" ref="survey_question_job_5"/>
<field eval="6" name="sequence"/>
</record>
<record id="survey_answer_job_87" model="survey.answer">
<field name="in_visible_answer_type">1</field>
<field name="answer">61 - 70</field>
<field name="question_id" ref="survey_question_job_5"/>
<field eval="7" name="sequence"/>
</record>
<record id="survey_answer_job_88" model="survey.answer">
<field name="in_visible_answer_type">1</field>
<field name="answer">71 +</field>
<field name="question_id" ref="survey_question_job_5"/>
<field eval="8" name="sequence"/>
</record>
<record id="survey_question_job_6" model="survey.question">
<field name="in_visible_answer_type">1</field>
<field name="validation_type">do_not_validate</field>
<field name="comment_valid_type">do_not_validate</field>
<field name="make_comment_field_err_msg">Please enter a comment.</field>
<field name="numeric_required_sum_err_msg">The choices need to add up to [enter sum here].</field>
<field eval="0" name="comment_column"/>
<field name="validation_valid_err_msg">The comment you entered is in an invalid format.</field>
<field eval="0" name="rating_allow_one_column_require"/>
<field name="req_error_msg">This question requires an answer.</field>
<field eval="3" name="sequence"/>
<field name="question">Experience</field>
<field eval="0" name="is_require_answer"/>
<field name="type">comment</field>
<field name="comment_valid_err_msg">The comment you entered is in an invalid format.</field>
<field eval="0" name="make_comment_field"/>
<field eval="1" name="in_visible_menu_choice"/>
<field name="page_id" ref="survey_page_job_1"/>
<field name="comment_label">Other</field>
<field eval="1" name="in_visible_rating_weight"/>
<field eval="0" name="allow_comment"/>
</record>
<record id="survey_question_job_7" model="survey.question">
<field name="in_visible_answer_type">1</field>
<field name="validation_type">do_not_validate</field>
<field name="comment_valid_type">do_not_validate</field>
<field name="make_comment_field_err_msg">Please enter a comment.</field>
<field name="numeric_required_sum_err_msg">The choices need to add up to [enter sum here].</field>
<field eval="0" name="comment_column"/>
<field name="validation_valid_err_msg">The comment you entered is in an invalid format.</field>
<field eval="0" name="rating_allow_one_column_require"/>
<field name="req_error_msg">This question requires an answer.</field>
<field eval="4" name="sequence"/>
<field name="question">Activities</field>
<field eval="0" name="is_require_answer"/>
<field name="type">comment</field>
<field name="comment_valid_err_msg">The comment you entered is in an invalid format.</field>
<field eval="0" name="make_comment_field"/>
<field eval="1" name="in_visible_menu_choice"/>
<field name="page_id" ref="survey_page_job_1"/>
<field name="comment_label">Other</field>
<field eval="1" name="in_visible_rating_weight"/>
<field eval="0" name="allow_comment"/>
</record>
<record id="survey_question_column_heading_job_0" model="survey.question.column.heading">
<field eval="1" name="in_visible_menu_choice"/>
<field name="title">Not important</field>
<field eval="1" name="in_visible_rating_weight"/>
<field name="question_id" ref="survey_question_job_1"/>
</record>
<record id="survey_question_column_heading_job_1" model="survey.question.column.heading">
<field eval="1" name="in_visible_menu_choice"/>
<field name="title">Somewhat important</field>
<field eval="1" name="in_visible_rating_weight"/>
<field name="question_id" ref="survey_question_job_1"/>
</record>
<record id="survey_question_column_heading_job_2" model="survey.question.column.heading">
<field eval="1" name="in_visible_menu_choice"/>
<field name="title">Important</field>
<field eval="1" name="in_visible_rating_weight"/>
<field name="question_id" ref="survey_question_job_1"/>
</record>
<record id="survey_question_column_heading_job_3" model="survey.question.column.heading">
<field eval="1" name="in_visible_menu_choice"/>
<field name="title">Very important</field>
<field eval="1" name="in_visible_rating_weight"/>
<field name="question_id" ref="survey_question_job_1"/>
</record>
<record id="survey_question_column_heading_job_4" model="survey.question.column.heading">
<field eval="1" name="in_visible_menu_choice"/>
<field name="title">Most important</field>
<field eval="1" name="in_visible_rating_weight"/>
<field name="question_id" ref="survey_question_job_1"/>
</record>
<record id="survey_answer_job_0" model="survey.answer">
<field name="in_visible_answer_type">1</field>
<field name="answer">Good pay</field>
<field name="question_id" ref="survey_question_job_1"/>
<field eval="1" name="sequence"/>
</record>
<record id="survey_answer_job_1" model="survey.answer">
<field name="in_visible_answer_type">1</field>
<field name="answer">Getting on with colleagues</field>
<field name="question_id" ref="survey_question_job_1"/>
<field eval="2" name="sequence"/>
</record>
<record id="survey_answer_job_2" model="survey.answer">
<field name="in_visible_answer_type">1</field>
<field name="answer">Office environment (décor, light, space etc)</field>
<field name="question_id" ref="survey_question_job_1"/>
<field eval="3" name="sequence"/>
</record>
<record id="survey_answer_job_3" model="survey.answer">
<field name="in_visible_answer_type">1</field>
<field name="answer">Desk space</field>
<field name="question_id" ref="survey_question_job_1"/>
<field eval="4" name="sequence"/>
</record>
<record id="survey_answer_job_4" model="survey.answer">
<field name="in_visible_answer_type">1</field>
<field name="answer">State of the art technology</field>
<field name="question_id" ref="survey_question_job_1"/>
<field eval="5" name="sequence"/>
</record>
<record id="survey_answer_job_5" model="survey.answer">
<field name="in_visible_answer_type">1</field>
<field name="answer">Office location (proximity to home)</field>
<field name="question_id" ref="survey_question_job_1"/>
<field eval="6" name="sequence"/>
</record>
<record id="survey_answer_job_6" model="survey.answer">
<field name="in_visible_answer_type">1</field>
<field name="answer">Good management/boss</field>
<field name="question_id" ref="survey_question_job_1"/>
<field eval="7" name="sequence"/>
</record>
<record id="survey_answer_job_7" model="survey.answer">
<field name="in_visible_answer_type">1</field>
<field name="answer">Freebies such as tea, coffee and stationery</field>
<field name="question_id" ref="survey_question_job_1"/>
<field eval="8" name="sequence"/>
</record>
<record id="survey_answer_job_8" model="survey.answer">
<field name="in_visible_answer_type">1</field>
<field name="answer">Perks such as free parking, gym passes etc</field>
<field name="question_id" ref="survey_question_job_1"/>
<field eval="9" name="sequence"/>
</record>
<record id="survey_answer_job_9" model="survey.answer">
<field name="in_visible_answer_type">1</field>
<field name="answer">No out of hours working</field>
<field name="question_id" ref="survey_question_job_1"/>
<field eval="10" name="sequence"/>
</record>
<record id="survey_answer_job_10" model="survey.answer">
<field name="in_visible_answer_type">1</field>
<field name="answer">Dress code</field>
<field name="question_id" ref="survey_question_job_1"/>
<field eval="11" name="sequence"/>
</record>
<record id="survey_answer_job_11" model="survey.answer">
<field name="in_visible_answer_type">1</field>
<field name="answer">Regular meetings</field>
<field name="question_id" ref="survey_question_job_1"/>
<field eval="12" name="sequence"/>
</record>
<record id="survey_answer_job_12" model="survey.answer">
<field name="in_visible_answer_type">1</field>
<field name="answer">Good social life (office nights out, good Christmas parties etc)</field>
<field name="question_id" ref="survey_question_job_1"/>
<field eval="13" name="sequence"/>
</record>
<record id="mail_alias_jobs" model="mail.alias">
<field name="alias_name">jobs</field>
<field name="alias_model_id" ref="model_hr_applicant"/>

View File

@ -126,35 +126,35 @@
<record id="hr.job_developer" model="hr.job">
<field name="state">recruit</field>
<field name="no_of_recruitment">4</field>
<field name="survey_id" ref="survey_job_0"/>
<field name="survey_id" ref="recruitment_form"/>
</record>
<record id="hr.job_ceo" model="hr.job">
<field name="survey_id" ref="survey_job_0"/>
<field name="survey_id" ref="recruitment_form"/>
</record>
<record id="hr.job_cto" model="hr.job">
<field name="survey_id" ref="survey_job_0"/>
<field name="survey_id" ref="recruitment_form"/>
</record>
<record id="hr.job_consultant" model="hr.job">
<field name="state">recruit</field>
<field name="no_of_recruitment">1</field>
<field name="survey_id" ref="survey_job_0"/>
<field name="survey_id" ref="recruitment_form"/>
</record>
<record id="hr.job_hrm" model="hr.job">
<field name="no_of_recruitment">1</field>
<field name="state">recruit</field>
<field name="survey_id" ref="survey_job_0"/>
<field name="survey_id" ref="recruitment_form"/>
</record>
<record id="hr.job_marketing" model="hr.job">
<field name="state">recruit</field>
<field name="no_of_recruitment">3</field>
<field name="survey_id" ref="survey_job_0"/>
<field name="survey_id" ref="recruitment_form"/>
</record>
<record id="hr.job_trainee" model="hr.job">
<field name="state">recruit</field>
<field name="no_of_recruitment">6</field>
<field name="survey_id" ref="survey_job_0"/>
<field name="survey_id" ref="recruitment_form"/>
</record>
-->
<record id="message_application_demo" model="mail.message">
<field name="model">hr.applicant</field>
<field name="res_id" ref="hr_case_advertisement"/>

View File

@ -54,7 +54,7 @@
<field name="date_action" invisible="context.get('invisible_next_date', True)"/>
<field name="source_id" invisible="1"/>
<field name="survey" invisible="1"/>
<field name="response" invisible="1"/>
<field name="response_id" invisible="1"/>
<field name="priority"/>
<field name="type_id" invisible="1"/>
<field name="availability" invisible="1"/>
@ -76,9 +76,9 @@
<div class="oe_right oe_button_box">
<button name="action_makeMeeting" type="object"
string="Schedule Meeting" help="Schedule interview with this applicant"/>
<button name="%(survey.action_view_survey_question_message)d" type="action"
<button name="action_start_survey" type="object"
string="Start Interview" help="Answer related job question"
context="{'survey_id': survey, 'response_id': [response], 'response_no':0 ,'active' : response, 'object' : 'hr.applicant'}"
context="{'survey_id': survey}"
attrs="{'invisible':[('survey','=',False)]}"/>
<button name="action_print_survey" type="object"
string="Print Interview" help="Print interview report"
@ -94,7 +94,7 @@
</h2>
<button string="Create Employee" name="create_employee_from_applicant" type="object"
class="oe_link oe_inline" style="margin-left: 8px;"
attrs="{'invisible': [('emp_id', '!=', False)]}"/>
attrs="{'invisible': [('emp_id', '!=', False)]}"/>
</div>
<group>
<group>
@ -106,7 +106,7 @@
<field name="type_id" placeholder="Degree"/>
</group>
<group>
<field name="user_id"
<field name="user_id"
context="{'default_groups_ref': ['base.group_user', 'base.group_partner_manager', 'base.group_hr_manager']}"/>
<label for="title_action"/>
<div>
@ -119,7 +119,7 @@
</group>
<group string="Job">
<field name="survey" invisible="1"/>
<field name="response" invisible="1"/>
<field name="response_id" invisible="1"/>
<field name="job_id" on_change="onchange_job(job_id)"/>
<field name="department_id" on_change="onchange_department_id(department_id, stage_id)"/>
<field name="company_id" />
@ -183,7 +183,7 @@
<separator/>
<filter string="Next Actions" context="{'invisible_next_action':False, 'invisible_next_date':False}"
domain="[('date_action','&lt;&gt;',False)]" help="Filter and view on next actions and date"/>
<field name="job_id"/>
<field name="department_id"/>
<field name="user_id"/>
@ -260,7 +260,7 @@
<li><a name="action_makeMeeting" type="object">Schedule Interview</a></li>
<li><ul class="oe_kanban_colorpicker" data-field="color"/></li>
</ul>
</div>
<div class="oe_kanban_content" tooltip="kanban-tooltip">
<div>
@ -295,9 +295,9 @@
</div>
<div class="oe_kanban_footer_left" style="margin-top:5px;">
<t t-raw="record.message_summary.raw_value"/>
<a t-if="record.attachment_number" name="action_get_attachment_tree_view" type="object" style="margin-right: 10px"> <field name="attachment_number"/> Documents</a>
<a t-if="record.attachment_number" name="action_get_attachment_tree_view" type="object" style="margin-right: 10px"> <field name="attachment_number"/> Documents</a>
</div>
</div>
<div class="oe_clear"></div>
</div>
@ -323,9 +323,9 @@
<field name="expected_employees" position="after">
<label for="survey_id" groups="base.group_user"/>
<div groups="base.group_user">
<field name="survey_id" class="oe_inline" domain="[('type','=','Human Resources')]"/>
<field name="survey_id" class="oe_inline" domain="[('res_model','=','hr.recruitment')]"/>
<button class="oe_inline"
string="Interview"
string="Print Interview Form"
name="action_print_survey" type="object"
attrs="{'invisible':[('survey_id','=',False)]}"/>
</div>

View File

@ -4,7 +4,7 @@ access_hr_recruitment_report,hr.recruitment.report,model_hr_recruitment_report,b
access_hr_recruitment_stage_user,hr.recruitment.stage.user,model_hr_recruitment_stage,base.group_hr_user,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,base.group_hr_user,1,1,1,0
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

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
4 access_hr_recruitment_stage_user hr.recruitment.stage.user model_hr_recruitment_stage base.group_hr_user 1 1 1 1
5 access_hr_recruitment_degree hr.recruitment.degree model_hr_recruitment_degree base.group_hr_user 1 1 1 1
6 access_res_partner_hr_user res.partner.user base.model_res_partner base.group_hr_user 1 1 1 1
7 access_survey_hr_user survey.hr.user survey.model_survey survey.model_survey_survey base.group_hr_user 1 1 1 0
8 access_calendar_event_hruser calendar.event.hruser calendar.model_calendar_event base.group_hr_user 1 1 1 1
9 access_hr_recruitment_source_hr_officer hr.recruitment.source model_hr_recruitment_source base.group_hr_user 1 1 1 1
10 access_hr_recruitment_source_all hr.recruitment.source model_hr_recruitment_source 1 0 0 0

View File

@ -5,10 +5,11 @@
<record model="survey.survey" id="recruitment_form">
<field name="title">Recruitment Form</field>
<field name="state">open</field>
<field name="res_model">hr.recruitment</field>
<field name="date_open" eval="time.strftime('%Y-%m-%d %H:%M:%S')" />
<field name="visible_to_user" eval="False"/>
<field name="auth_required" eval="True" />
<field name="users_can_go_back" eval="False" />
<field name="users_can_go_back" eval="True" />
<field name="description">&lt;p&gt;This form is intended to help the responsible of a recruitment interview.&lt;/p&gt;</field>
<field name="thank_you_message">&lt;p&gt;&lt;/p&gt;</field>
</record>

View File

@ -46,7 +46,6 @@ sent mails with personal token for the invitation of the survey.
'data/survey_cron.xml'
],
'demo': ['data/survey_demo_user.xml',
'data/survey_demo_recruitment.xml',
'data/survey_demo_feedback.xml',
'data/survey_demo_appraisal.xml',
'data/survey.user_input.csv',

View File

@ -252,11 +252,14 @@ class survey_survey(osv.Model):
def action_start_survey(self, cr, uid, ids, context=None):
''' Open the website page with the survey form '''
trail = ""
if context and 'survey_token' in context:
trail = context['survey_token'] + "/"
return {
'type': 'ir.actions.act_url',
'name': "Start Survey",
'target': 'self',
'url': self.read(cr, uid, ids, ['public_url'], context=context)[0]['public_url']
'url': self.read(cr, uid, ids, ['public_url'], context=context)[0]['public_url'] + trail
}
def action_send_survey(self, cr, uid, ids, context=None):
@ -298,11 +301,14 @@ class survey_survey(osv.Model):
def action_print_survey(self, cr, uid, ids, context=None):
''' Open the website page with the survey printable view '''
trail = ""
if context and 'survey_token' in context:
trail = context['survey_token'] + "/"
return {
'type': 'ir.actions.act_url',
'name': "Print Survey",
'target': 'self',
'url': self.read(cr, uid, ids, ['print_url'], context=context)[0]['print_url']
'url': self.read(cr, uid, ids, ['print_url'], context=context)[0]['print_url'] + trail
}
def action_result_survey(self, cr, uid, ids, context=None):