From 02a54db3a730f27d8aafdb08c82692ea845c5575 Mon Sep 17 00:00:00 2001 From: "Harry (Open ERP)" Date: Fri, 9 Apr 2010 12:03:01 +0530 Subject: [PATCH] [IMP] survey, hr_evalution, hr_recruitment: improvement bzr revid: hmo@tinyerp.com-20100409063301-q8qqxtt33jnxv378 --- addons/hr_evaluation/hr_evaluation.py | 45 +++++++ addons/hr_evaluation/hr_evaluation_view.xml | 8 +- addons/hr_recruitment/hr_recruitment.py | 137 +++++++++++++++++++- addons/hr_recruitment/hr_recruitment_view.xml | 16 ++- addons/hr_recruitment/hr_recruitment_wizard.xml | 8 -- .../hr_recruitment/wizard/hr_recruitment_wizard.py | 55 -------- addons/survey/survey.py | 40 ++++++ addons/survey/survey_view.xml | 4 +- 8 files changed, 235 insertions(+), 78 deletions(-) diff --git a/addons/hr_evaluation/hr_evaluation.py b/addons/hr_evaluation/hr_evaluation.py index 1f3e960..590c1a9 100644 --- a/addons/hr_evaluation/hr_evaluation.py +++ b/addons/hr_evaluation/hr_evaluation.py @@ -300,6 +300,51 @@ class hr_evaluation_interview(osv.osv): self.write(cr, uid, ids, { 'state' : 'cancel'}, context=context) return True + 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). + + @param self: The object pointer + @param cr: the current row, from the database cursor, + @param uid: the current user’s 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 not context: + context = {} + record = self.browse(cr, uid, ids, context) + record = record and record[0] + datas = {} + page_setting = {'orientation': 'vertical', 'without_pagebreak': 0, 'paper_size': 'letter', 'page_number': 1, 'survey_title': 1} + report = {} + if record: + datas['ids'] = [record.survey_id.id] + response_id = record.response.id + if response_id: + context.update({'survey_id': datas['ids'], 'response_id' : [response_id], 'response_no':0}) + datas['form'] = page_setting + datas['model'] = 'survey.print.answer' + report = { + 'type': 'ir.actions.report.xml', + 'report_name': 'survey.browse.response', + 'datas': datas, + 'nodestroy': True, + 'context' : context + } + else: + datas['form'] = page_setting + datas['model'] = 'survey.print' + report = { + 'type': 'ir.actions.report.xml', + 'report_name': 'survey.form', + 'datas': datas, + 'nodestroy':True, + 'context' : context + } + return report + + hr_evaluation_interview() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:1 diff --git a/addons/hr_evaluation/hr_evaluation_view.xml b/addons/hr_evaluation/hr_evaluation_view.xml index fa50f94..d59ac82 100644 --- a/addons/hr_evaluation/hr_evaluation_view.xml +++ b/addons/hr_evaluation/hr_evaluation_view.xml @@ -261,8 +261,8 @@