[IMP]:improved survey module for hr_evaluation and hr_recruitment.

bzr revid: apa@tinyerp.com-20100304103015-a9vjs864xurljdv5
This commit is contained in:
ysa(OpenERP) 2010-03-04 16:00:15 +05:30 committed by apa-tiny
parent 77222a0ac2
commit bbbcb52ae2
4 changed files with 9 additions and 9 deletions

View File

@ -171,7 +171,7 @@
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Evaluation">
<field name="create_date"/>
<!--field name="create_date"/-->
<field name="employee_id"/>
<!-- field name="progress"/ -->
<field name="plan_id"/>
@ -202,9 +202,9 @@
<field name="survey_id" widget="selection" colspan="3"/>
<group colspan="1">
<button name="%(survey.action_view_survey_question_message)d" string="Interview Question" type="action"
icon="gtk-execute" context="{'survey_id': survey_id, 'response_id': response, 'active' : response, 'object' : 'hr.evaluation.interview', 'cur_id' : active_id}" attrs="{'readonly':[('survey_id','=',False)]}"/>
icon="gtk-execute" context="{'survey_id': survey_id, 'response_id': [response], 'response_no':0, 'active' : response, 'object' : 'hr.evaluation.interview', 'cur_id' : active_id}" attrs="{'readonly':[('survey_id','=',False)]}"/>
<button name="%(survey.survey_browse_response)d" string="Print Interview" type="action"
icon="gtk-print" context="{'survey_id': survey_id, 'response_id' : response,}" attrs="{'readonly':[('response','!=',True),('survey_id','!=',True)]}" />
icon="gtk-print" context="{'survey_id': survey_id, 'response_id' : [response], 'response_no':0,}" attrs="{'readonly':[('response','=',False)]}" />
</group>
</group>
<group col="4" colspan="4">

View File

@ -79,14 +79,14 @@
<button string="Schedule a Phone Call"
name="%(wizard_hr_job_reschedule_phone_call)d" icon="gtk-redo" type="action"/>
<button name="%(survey.action_view_survey_question_message)d" string="Interview Question" type="action"
icon="gtk-execute" context="{'survey_id': survey, 'response_id': response ,'active' : response, 'object' : 'hr.applicant', 'cur_id' :active_id}" attrs="{'readonly':[('survey','=',False)]}"/>
icon="gtk-execute" context="{'survey_id': survey, 'response_id': [response], 'response_no':0 ,'active' : response, 'object' : 'hr.applicant', 'cur_id' :active_id}" attrs="{'readonly':[('survey','=',False)]}"/>
<newline/>
<field name="partner_name"/>
<field name="job_id"/>
<field name="department_id" widget="selection"/>
<button name="%(wizard_hr_job_meeting_set)d" string="Schedule Meeting" icon="terp-hr" type="action"/>
<button name="%(survey.survey_browse_response)d" string="Print Interview" type="action"
icon="gtk-print" context="{'survey_id': survey, 'response_id' : response,}" attrs="{'readonly':[('response','=',False)]}" />
icon="gtk-print" context="{'survey_id': survey, 'response_id' : [response], 'response_no':0,}" attrs="{'readonly':[('response','=',False)]}" />
</group>
<notebook colspan="4">
<page string="Job Info">

View File

@ -187,7 +187,7 @@ class survey_browse_response(report_rml):
if datas.has_key('form') and datas['form'].has_key('response_ids'):
response_id = datas['form']['response_ids'][0][2]
elif context.has_key('response_id') and context['response_id']:
response_id = [int(context['response_id'])]
response_id = [int(context['response_id'][0])]
else:
response_id = surv_resp_obj.search(cr, uid, [('survey_id', 'in', ids)])
surv_resp_line_obj = pooler.get_pool(cr.dbname).get('survey.response.line')

View File

@ -691,7 +691,7 @@ class survey_question_wiz(osv.osv_memory):
total_pages = len(p_id)
pre_button = False
readonly = 0
if context.has_key('response_id') and context['response_id']:
if context.has_key('response_id') and context['response_id'] and int(context['response_id'][0]) > 0:
readonly = 1
if not sur_name_rec['page_no'] + 1 :
surv_name_wiz.write(cr, uid, [context['sur_name_id']], {'store_ans':{}})
@ -731,7 +731,7 @@ class survey_question_wiz(osv.osv_memory):
pag_rec = page_obj.read(cr, uid, p_id)
xml_form = etree.Element('form', {'string': _(tools.ustr(pag_rec['title']))})
xml_group = etree.SubElement(xml_form, 'group', {'col': '1', 'colspan': '4'})
if context.has_key('response_id'):
if context.has_key('response_id') and context['response_id'] and int(context['response_id'][0]) > 0:
xml_group = etree.SubElement(xml_form, 'group', {'col': '40', 'colspan': '4'})
record = sur_response_obj.browse(cr, uid, context['response_id'][context['response_no']])
etree.SubElement(xml_group, 'label', {'string': to_xml(tools.ustr('Answer Of :- ' + record.user_id.name + ', Date :- ' + record.date_create.split('.')[0] )), 'align':"0.0"})
@ -1011,7 +1011,7 @@ class survey_question_wiz(osv.osv_memory):
tot_per = (float(100) * (int(field.split('_')[2]) + 1) / len(tot_page_id.page_ids))
value[field] = tot_per
response_obj = self.pool.get('survey.response')
if context.has_key('response_id') and context['response_id']:
if context.has_key('response_id') and context['response_id'] and int(context['response_id'][0]) > 0:
data = super(survey_question_wiz, self).default_get(cr, uid, fields_list, context)
response_ans = response_obj.browse(cr, uid, context['response_id'][context['response_no']])
fields_list.sort()