Bharat Devnani (Open ERP) has proposed merging
lp:~openerp-dev/openobject-addons/trunk-bug-891037-bde into
lp:openobject-addons.
Requested reviews:
OpenERP Core Team (openerp)
Related bugs:
Bug #891037 in OpenERP Addons: "hr_evaluation : survey of employee is not
able to being done and allows unlimited no. of time to answer"
https://bugs.launchpad.net/openobject-addons/+bug/891037
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-891037-bde/+merge/83158
Hello Sir,
I have made some changes in hr_evaluation/hr_evaluation.py and
survey/wizard/survey_answer.py inorder to fix the bug.
Thanks & Regards,
Devnani Bharat R.
--
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-891037-bde/+merge/83158
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-addons/trunk-bug-891037-bde.
=== modified file 'hr_evaluation/hr_evaluation.py'
--- hr_evaluation/hr_evaluation.py 2011-11-11 20:29:46 +0000
+++ hr_evaluation/hr_evaluation.py 2011-11-23 13:08:30 +0000
@@ -312,7 +312,7 @@
for id in self.browse(cr, uid, ids, context=context):
flag = False
wating_id = 0
- tot_done_req = 1
+ tot_done_req = 0
if not id.evaluation_id.id:
raise osv.except_osv(_('Warning !'),_("You cannot start evaluation without Appraisal."))
records = hr_eval_obj.browse(cr, uid, [id.evaluation_id.id], context=context)[0].survey_request_ids
=== modified file 'survey/wizard/survey_answer.py'
--- survey/wizard/survey_answer.py 2011-11-09 18:12:56 +0000
+++ survey/wizard/survey_answer.py 2011-11-23 13:08:30 +0000
@@ -56,7 +56,8 @@
que_col_head = self.pool.get('survey.question.column.heading')
user_obj = self.pool.get('res.users')
mail_message = self.pool.get('mail.message')
-
+ obj_module = self.pool.get('ir.module.module')
+
if view_type in ['form']:
wiz_id = 0
sur_name_rec = None
@@ -394,6 +395,13 @@
survey_data = survey_obj.browse(cr, uid, survey_id)
response_id = surv_name_wiz.read(cr, uid, context.get('sur_name_id',False))['response']
context.update({'response_id':response_id})
+ module_id = obj_module.search(cr, uid, [('name', '=', 'hr_evaluation')])
+ state = obj_module.browse(cr, uid, module_id, context=context)[0].state
+ if state == 'installed':
+ interview_id = context.get('active_ids',False)
+ eval_inter_obj = self.pool.get('hr.evaluation.interview')
+ eval_inter_obj.write(cr, uid, interview_id, {'response': response_id, 'state' : 'done'}, context=context)
+ eval_inter_obj.survey_req_done(cr, uid, interview_id, context=context)
report = self.create_report(cr, uid, [survey_id], 'report.survey.browse.response', survey_data.title,context)
attachments = {}
file = open(addons.get_module_resource('survey', 'report') + survey_data.title + ".pdf")
@@ -407,7 +415,7 @@
attachments[survey_data.title + ".pdf"] = file_data
file.close()
os.remove(addons.get_module_resource('survey', 'report') + survey_data.title + ".pdf")
-
+
user_email = user_obj.browse(cr, uid, uid, context).user_email
resp_email = survey_data.responsible_id and survey_data.responsible_id.user_email or False
@@ -512,7 +520,7 @@
return value
if context.has_key('active') and context.get('active',False):
return value
-
+
sur_name_read = surv_name_wiz.read(cr, uid, context.get('sur_name_id',False))
ans_list = []
@@ -528,7 +536,7 @@
Create the Answer of survey and store in survey.response object, and if set validation of question then check the value of question if value is wrong then raise the exception.
"""
if context is None: context = {}
-
+
survey_question_wiz_id = super(survey_question_wiz,self).create(cr, uid, vals, context=context)
if context.has_key('active') and context.get('active',False):
return survey_question_wiz_id
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp