wait = True
if not wait:
hr_eval_inter_obj.survey_req_waiting_answer(cr, uid, [int_id], context=context)
+ elif wait:
+ hr_eval_inter_obj.survey_req_draft_answer(cr, uid, [int_id], context=context)
if (not wait) and phase.mail_feature:
body = phase.mail_body % {'employee_name': child.name, 'user_signature': child.user_id.signature,
def survey_req_waiting_answer(self, cr, uid, ids, context=None):
self.write(cr, uid, ids, { 'state': 'waiting_answer'}, context=context)
return True
+
+ def survey_req_draft_answer(self, cr, uid, ids, context=None):
+ self.write(cr, uid, ids, { 'state': 'draft'}, context=context)
+ return True
def survey_req_done(self, cr, uid, ids, context=None):
hr_eval_obj = self.pool.get('hr_evaluation.evaluation')
que_col_head = self.pool.get('survey.question.column.heading')
user_obj = self.pool.get('res.users')
mail_message = self.pool.get('mail.message')
+ obj_module = self.pool.get('ir.module.module')
if view_type in ['form']:
wiz_id = 0
survey_data = survey_obj.browse(cr, uid, survey_id)
response_id = surv_name_wiz.read(cr, uid, context.get('sur_name_id',False))['response']
context.update({'response_id':response_id})
+ module_id = obj_module.search(cr, uid, [('name', '=', 'hr_evaluation')])
+ state = obj_module.browse(cr, uid, module_id, context=context)[0].state
+ if state == 'installed':
+ interview_id = context.get('active_ids',False)
+ eval_inter_obj = self.pool.get('hr.evaluation.interview').survey_req_done(cr, uid, interview_id, context=context)
report = self.create_report(cr, uid, [survey_id], 'report.survey.browse.response', survey_data.title,context)
attachments = {}
file = open(addons.get_module_resource('survey', 'report') + survey_data.title + ".pdf")