[IMP] survey, hr_recruitment, hr_evaluation :- improve action_print_survey method.
bzr revid: ysa@tinyerp.co.in-20100409112238-7q2n1grep79z05fp
This commit is contained in:
parent
0150c68e00
commit
afb1b15fec
|
@ -313,37 +313,12 @@ class hr_evaluation_interview(osv.osv):
|
|||
"""
|
||||
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
|
||||
|
||||
context.update({'survey_id': record.survey_id.id, 'response_id' : [record.response.id], 'response_no':0,})
|
||||
value = self.pool.get("survey").action_print_survey(cr, uid, ids, context)
|
||||
return value
|
||||
|
||||
hr_evaluation_interview()
|
||||
|
||||
|
|
|
@ -163,36 +163,11 @@ class hr_applicant(osv.osv):
|
|||
"""
|
||||
if not context:
|
||||
context = {}
|
||||
datas = {}
|
||||
record = self.browse(cr, uid, ids, context)
|
||||
record = record and record[0]
|
||||
page_setting = {'orientation': 'vertical', 'without_pagebreak': 0, 'paper_size': 'letter', 'page_number': 1, 'survey_title': 1}
|
||||
report = {}
|
||||
if record:
|
||||
datas['ids'] = [record.survey.id]
|
||||
response_id = record.response
|
||||
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
|
||||
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)
|
||||
return value
|
||||
|
||||
hr_applicant()
|
||||
|
||||
|
|
|
@ -108,11 +108,15 @@ class survey(osv.osv):
|
|||
if not context:
|
||||
context = {}
|
||||
datas = {}
|
||||
response_id = self.pool.get('survey.response').search(cr, uid, [('survey_id','=', ids)], context=context)
|
||||
if 'response_id' in context:
|
||||
response_id = context.get('response_id', 0)
|
||||
datas['ids'] = [context.get('survey_id', 0)]
|
||||
else:
|
||||
response_id = self.pool.get('survey.response').search(cr, uid, [('survey_id','=', ids)], context=context)
|
||||
datas['ids'] = ids
|
||||
page_setting = {'orientation': 'vertical', 'without_pagebreak': 0, 'paper_size': 'letter', 'page_number': 1, 'survey_title': 1}
|
||||
report = {}
|
||||
datas['ids'] = ids
|
||||
if response_id:
|
||||
if response_id and response_id[0]:
|
||||
context.update({'survey_id': datas['ids']})
|
||||
datas['form'] = page_setting
|
||||
datas['model'] = 'survey.print.answer'
|
||||
|
@ -124,6 +128,7 @@ class survey(osv.osv):
|
|||
'context' : context
|
||||
}
|
||||
else:
|
||||
|
||||
datas['form'] = page_setting
|
||||
datas['model'] = 'survey.print'
|
||||
report = {
|
||||
|
|
Loading…
Reference in New Issue