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()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:1
<field name="arch" type="xml">
<search string="Search Evaluation">
<group col='10' colspan='4'>
- <filter icon="terp-crm" string="To Do" domain="[('state','=','waiting_answer')]" default="1"/>
+ <filter icon="terp-crm" string="To Do" name="todo" domain="[('state','=','waiting_answer')]"/>
<separator orientation="vertical"/>
- <filter string="My" icon="terp-partner" domain="[('user_id','=',uid)]" default="1"/>
+ <filter string="My" icon="terp-partner" name="my" domain="[('user_id','=',uid)]"/>
<separator orientation="vertical"/>
<filter icon="terp-stock" string="Late" domain="[('date_deadline','<',current_date)]"/>
<separator orientation="vertical"/>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('is_evaluation' ,'=', True)]</field>
+ <field name="context">{"search_default_todo":1,"search_default_my":1}</field>
<field name="search_view_id" ref="view_hr_evaluation_interview_search"/>
</record>
"""
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()
'survey_id': fields.many2one('survey', 'Survey'),
}
-hr_job()
\ No newline at end of file
+hr_job()
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'