From: apa-tiny Date: Wed, 3 Feb 2010 08:35:53 +0000 (+0530) Subject: [IMP]:survey,hr_evaluation.(Ref-YSA,APA). X-Git-Tag: 6.0.0-rc1-addons~1551^2~4 X-Git-Url: http://git.inspyration.org/?a=commitdiff_plain;h=e0c47c2c8775df89866acbebe22fe17db71256e2;p=odoo%2Fodoo.git [IMP]:survey,hr_evaluation.(Ref-YSA,APA). Fixed: -Survey analysis report error. -Table contain not display. -Create question type= drop down menu... then error menu choice not exists. -Status change in survey.response. finished and not finished. -Remove button in survey.response. -Response display page wise. -Evaluation data changed. bzr revid: apa@tinyerp.com-20100203083553-th7b1jq7ksskitjo --- diff --git a/addons/hr_evaluation/hr_evaluation_data.xml b/addons/hr_evaluation/hr_evaluation_data.xml index 2a3d72d..d2223e4 100644 --- a/addons/hr_evaluation/hr_evaluation_data.xml +++ b/addons/hr_evaluation/hr_evaluation_data.xml @@ -41,9 +41,31 @@ EMPLOYEE PERFORMANCE IN KEY AREAS + The appraiser should rate the employee’s major work accomplishments and performance according to the metric provided below : + 1 - Significantly exceeds standards and expectations required of the position + 2 - Exceeds standards and expectations + 3 - Meet standards and expectations + 4 - Did not meet standards and expectations + 5 - Significantly below standards and expectations + + + PROFESSIONAL DEVELOPMENT AND PERFORMANCE PLAN (optional) + + + Identify professional, performance, or project objectives you recommend for employee’s continued career development over the coming year. + + + + + + EMPLOYEE COMMENTS + + + + @@ -519,7 +541,14 @@ Once the form had been filled, the employee send it to his supervisor. The comment you entered is in an invalid format. * His direct reports will be invited through OpenERP to express a feedback on their supervisor's leadership and to give their opinion about their own engagement and effectiveness, the continuous improvement and openness in action in the company, ... -* The employees will send back their anonymous answers to OpenERP. The data will be handled by the HR manager and a brief summary of the data will be sent to the concerned supervisor, to his team and to the supervisor's supervisor. +* The employees will send back their anonymous answers to OpenERP. The data will be handled by the HR manager and a brief summary of the data will be sent to the concerned supervisor, to his team and to the supervisor's supervisor. +* The appraiser should rate the employee’s major work accomplishments and performance according to the metric provided below : + + 1 - Significantly exceeds standards and expectations required of the position + 2 - Exceeds standards and expectations + 3 - Meet standards and expectations + 4 - Did not meet standards and expectations + 5 - Significantly below standards and expectations @@ -573,9 +602,102 @@ Once the form had been filled, the employee send it to his supervisor. + + + do_not_validate + do_not_validate + Please enter a comment. + The choices need to add up to [enter sum here]. + + The comment you entered is in an invalid format. + + This question requires an answer. + + PROFESSIONAL DEVELOPMENT OBJECTIVES + + comment + The comment you entered is in an invalid format. + + + + Other + + + + + + + do_not_validate + do_not_validate + Please enter a comment. + The choices need to add up to [enter sum here]. + + The comment you entered is in an invalid format. + + This question requires an answer. + + PERSONAL PERFORMANCE OBJECTIVES + + comment + The comment you entered is in an invalid format. + + + + Other + + + + + + + + do_not_validate + do_not_validate + Please enter a comment. + The choices need to add up to [enter sum here]. + + The comment you entered is in an invalid format. + + This question requires an answer. + + PROJECT OBJECTIVES + + comment + The comment you entered is in an invalid format. + + + + Other + + + + + + do_not_validate + do_not_validate + Please enter a comment. + The choices need to add up to [enter sum here]. + + The comment you entered is in an invalid format. + + This question requires an answer. + + Use the following space to make any comments regarding the above performance evaluation. + + comment + The comment you entered is in an invalid format. + + + + Other + + + + + 1 diff --git a/addons/survey/report/survey_analysis_report.py b/addons/survey/report/survey_analysis_report.py index 0694880..b9c74eb 100755 --- a/addons/survey/report/survey_analysis_report.py +++ b/addons/survey/report/survey_analysis_report.py @@ -167,7 +167,7 @@ class survey_analysis(report_rml): if cal['answer'] == matrix_ans[mat_col]: cal_count = cal['count'] if tot_res: - percantage = float(cal_count)*100 / tot_res + percantage = round(float(cal_count)*100 / tot_res,2) if percantage: rml += """""" + tools.ustr(percantage) +"% (" + tools.ustr(cal_count) + """)""" else: @@ -257,14 +257,17 @@ class survey_analysis(report_rml): sqc.question_id = sr.question_id and sra.answer_id = %d and sqc.title ='%s'\ group by sra.answer_id,sqc.rating_weight" % (ans.id,matrix_ans[mat_col])) col_weight = cr.fetchone() - if not col_weight : + + if not col_weight: col_weight= (0,0) + elif not col_weight[1]: + col_weight = (col_weight[0],0) res_count = col_weight[0] - if tot_res: - rating_weight_sum += col_weight[1] * tot_res + if tot_res and res_count: + rating_weight_sum += int(col_weight[1]) * tot_res tot_per = round((float(tot_res) * 100) / int(res_count), 2) else: - tot_res = 0 + tor_res = 0 tot_per = 0.0 if tot_res: rml += """""" + tools.ustr(tot_per) + "%(" + tools.ustr(tot_res) + """)""" @@ -309,7 +312,7 @@ class survey_analysis(report_rml): calc = per['count'] percantage = 0.00 if calc and response: - percantage = (float(calc)* 100) / response + percantage = round((float(calc)* 100) / response,2) if calc: rml+="""""" +tools.ustr(percantage)+"% (" + tools.ustr(calc) + """)""" else: diff --git a/addons/survey/report/survey_browse_response.py b/addons/survey/report/survey_browse_response.py index 6e26f21..a1e07cd 100644 --- a/addons/survey/report/survey_browse_response.py +++ b/addons/survey/report/survey_browse_response.py @@ -51,6 +51,10 @@ class survey_browse_response(report_rml): + + + + @@ -139,11 +143,11 @@ class survey_browse_response(report_rml): 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') surv_obj = pooler.get_pool(cr.dbname).get('survey') - for response in surv_resp_obj.browse(cr,uid, response_id): + for response in surv_resp_obj.browse(cr,uid, response_id): for survey in surv_obj.browse(cr, uid, [response.survey_id.id]): - status = "Skip" + status = "Not Finished" if response.state == "done": - status = "Complete" + status = "Finished" rml += """ @@ -183,6 +187,13 @@ class survey_browse_response(report_rml): Page :- """ + to_xml(tools.ustr(page.title)) + """ """ + if page.note: + rml += """ + + + """ + to_xml(tools.ustr(page.note)) + """ + + """ for que in page.question_ids: rml += """ @@ -213,11 +224,14 @@ class survey_browse_response(report_rml): rml +="""""" table_data = col_heading.browse(cr, uid, col_heading.search(cr, uid, [('response_table_id', '=', answer[0].id),('name','=',row)])) for column in matrix_ans: - value = """ """ + value = False for col in table_data: if column == col.column_id.title: value = col.value - rml += """ """ + to_xml(tools.ustr(value)) +"""""" + if value: + rml += """ """ + to_xml(tools.ustr(value)) +"""""" + else: + rml += """ """ rml += """""" else: rml +=""" @@ -354,8 +368,8 @@ class survey_browse_response(report_rml): rml +=""" No Response """ - - rml += """""" + + rml += """""" rml += """""" report_type = datas.get('report_type', 'pdf') create_doc = self.generators[report_type] diff --git a/addons/survey/report/survey_form.py b/addons/survey/report/survey_form.py index 725e213..0cdc919 100644 --- a/addons/survey/report/survey_form.py +++ b/addons/survey/report/survey_form.py @@ -102,6 +102,10 @@ class survey_form(report_rml): + + + + @@ -147,6 +151,10 @@ class survey_form(report_rml): """+ tools.ustr(seq) + """. """ + to_xml(tools.ustr(page.title)) + """ """ + if page.note: + rml += """ + """ + to_xml(tools.ustr(page.note or '')) + """ + """ for que in page.question_ids: cols_widhts=[] rml +=""" diff --git a/addons/survey/survey.py b/addons/survey/survey.py index 632f4c7..8f3f822 100644 --- a/addons/survey/survey.py +++ b/addons/survey/survey.py @@ -331,9 +331,9 @@ class survey_question(osv.osv): raise osv.except_osv(_('Error !'),_("Maximum Required Answer is greater than Minimum Required Answer")) if question['type'] == 'matrix_of_drop_down_menus' and vals.has_key('column_heading_ids'): for col in vals['column_heading_ids']: - if col[2] and col[2].has_key('menu_choice') and not col[2]['menu_choice']: + if not col[2] or not col[2].has_key('menu_choice') or not col[2]['menu_choice']: raise osv.except_osv(_('Error !'),_("You must enter one or more menu choices in column heading")) - elif col[2] and col[2].has_key('menu_choice') and col[2]['menu_choice'].strip() == '': + elif not col[2] or not col[2].has_key('menu_choice') or col[2]['menu_choice'].strip() == '': raise osv.except_osv(_('Error !'),_("You must enter one or more menu choices in column heading (white spaces not allowed)")) return super(survey_question, self).write(cr, uid, ids, vals, context=context) @@ -361,9 +361,9 @@ class survey_question(osv.osv): raise osv.except_osv(_('Error !'),_("Maximum Required Answer is greater than Minimum Required Answer")) if vals['type'] == 'matrix_of_drop_down_menus': for col in vals['column_heading_ids']: - if not col[2]['menu_choice']: + if not col[2] or not col[2].has_key('menu_choice') or not col[2]['menu_choice']: raise osv.except_osv(_('Error !'),_("You must enter one or more menu choices in column heading")) - elif col[2]['menu_choice'].strip() == '': + elif not col[2] or not col[2].has_key('menu_choice') or col[2]['menu_choice'].strip() == '': raise osv.except_osv(_('Error !'),_("You must enter one or more menu choices in column heading (white spaces not allowed)")) res = super(survey_question, self).create(cr, uid, vals, context) return res @@ -479,18 +479,11 @@ class survey_response(osv.osv): 'user_id' : fields.many2one('res.users', 'User'), 'response_type' : fields.selection([('manually', 'Manually'), ('link', 'Link')], 'Response Type', required=1), 'question_ids' : fields.one2many('survey.response.line', 'response_id', 'Response Answer'), - 'state' : fields.selection([('done', 'Completed '),('skip', 'Skiped')], 'Status', readonly=True), + 'state' : fields.selection([('done', 'Finished '),('skip', 'Not Finished')], 'Status', readonly=True), } _defaults = { 'state' : lambda * a: "skip", } - def response_done(self, cr, uid, ids, arg): - self.write(cr, uid, ids, { 'state' : 'done' }) - return True - - def response_skip(self, cr, uid, ids, arg): - self.write(cr, uid, ids, { 'state' : 'skip' }) - return True survey_response() @@ -765,9 +758,20 @@ class survey_question_wiz(osv.osv_memory): fields[tools.ustr(que) + "_" + tools.ustr(row['id']) + "_" + tools.ustr(col['title'])] = {'type':'selection', 'string': col['title'], 'selection':selection} elif que_rec['type'] == 'multiple_textboxes': xml_group = etree.SubElement(xml_group, 'group', {'col': '1', 'colspan': '4'}) + type = "char" + if que_rec['is_validation_require']: + if que_rec['validation_type'] in ['must_be_whole_number']: + type = "integer" + elif que_rec['validation_type'] in ['must_be_decimal_number']: + type = "float" + elif que_rec['validation_type'] in ['must_be_date']: + type = "date" for ans in ans_ids: etree.SubElement(xml_group, 'field', {'name': tools.ustr(que) + "_" + tools.ustr(ans['id']) + "_multi"}) - fields[tools.ustr(que) + "_" + tools.ustr(ans['id']) + "_multi"] = {'type':'char', 'size':255, 'string':ans['answer']} + if type == "char" : + fields[tools.ustr(que) + "_" + tools.ustr(ans['id']) + "_multi"] = {'type':'char', 'size':255, 'string':ans['answer']} + else: + fields[tools.ustr(que) + "_" + tools.ustr(ans['id']) + "_multi"] = {'type': str(type), 'string':ans['answer']} elif que_rec['type'] == 'numerical_textboxes': xml_group = etree.SubElement(xml_group, 'group', {'col': '2', 'colspan': '2'}) for ans in ans_ids: @@ -969,6 +973,7 @@ class survey_question_wiz(osv.osv_memory): comment_value = False response_list = [] for key1, val1 in vals.items(): + print "FOR::::::::::",key1,val1 if val1 and key1.split('_')[1] == "table" and key1.split('_')[0] == que_id: surv_tbl_column_obj.create(cr, uid, {'response_table_id' : resp_id,'column_id':key1.split('_')[2], 'name':key1.split('_')[3], 'value' : val1}) sur_name_read['store_ans'][resp_id].update({key1:val1}) @@ -1069,10 +1074,13 @@ class survey_question_wiz(osv.osv_memory): select_count += 1 numeric_sum += int(val1) elif val1 and que_id == key1.split('_')[0] and len(key1.split('_')) == 3: + print "V:::::::::::::::::",key1, val1 if type(val1) == type('') or type(val1) == type(u''): + print "VA:::::::::::::::::::DROP DOWN::::::::" ans_create_id = res_ans_obj.create(cr, uid, {'response_id':resp_id, 'answer_id':key1.split('_')[1], 'answer' : key1.split('_')[2], 'value_choice' : val1}) sur_name_read['store_ans'][resp_id].update({key1:val1}) else: + print ":A:::::::::::::multiple answer :::" ans_create_id = res_ans_obj.create(cr, uid, {'response_id':resp_id, 'answer_id':key1.split('_')[1], 'answer' : key1.split('_')[2]}) sur_name_read['store_ans'][resp_id].update({key1:True}) matrix_list.append(key1.split('_')[0] + '_' + key1.split('_')[1]) diff --git a/addons/survey/survey_demo.xml b/addons/survey/survey_demo.xml index 88f632a..03ac38d 100644 --- a/addons/survey/survey_demo.xml +++ b/addons/survey/survey_demo.xml @@ -416,7 +416,7 @@ In your opinion, how could Tiny better communicate with partners and on which subjects? - single_textbox + comment 1 1 diff --git a/addons/survey/survey_view.xml b/addons/survey/survey_view.xml index 5085ed4..5c84eb6 100644 --- a/addons/survey/survey_view.xml +++ b/addons/survey/survey_view.xml @@ -903,13 +903,7 @@ - - -