[FIX+IMP] hr_evaluation, survey
bzr revid: hmo@tinyerp.com-20100409143320-vqxx9vue8ip8cow2
This commit is contained in:
committed by
Harry (Open ERP)
parent
10a317d824
commit
12da11384e
@@ -315,36 +315,9 @@ class hr_evaluation_interview(osv.osv):
|
||||
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
|
||||
|
||||
@@ -311,9 +311,9 @@
|
||||
<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"/>
|
||||
@@ -329,6 +329,7 @@
|
||||
<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>
|
||||
|
||||
|
||||
@@ -163,36 +163,12 @@ 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()
|
||||
|
||||
@@ -203,4 +179,4 @@ class hr_job(osv.osv):
|
||||
'survey_id': fields.many2one('survey', 'Survey'),
|
||||
}
|
||||
|
||||
hr_job()
|
||||
hr_job()
|
||||
|
||||
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user