Merge lp:~openerp-dev/openobject-addons/trunk-bug-1219790-cod into lp:openobject-addons

Proposed by Chirag Dodiya(OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-1219790-cod
Merge into: lp:openobject-addons
Diff against target: 89 lines (+13/-8)
4 files modified
hr_evaluation/test/test_hr_evaluation.yml (+1/-1)
survey/report/survey_browse_response.py (+1/-1)
survey/survey.py (+8/-3)
survey/wizard/survey_answer.py (+3/-3)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-1219790-cod
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+203469@code.launchpad.net

Description of the change

Hello,

     I have fixed this 2 bugs in hr recruitment,
       -> traceback when completing the survey,
       -> Print interview not working properly.

Thanks,
Chirag Dodiya(cod).

To post a comment you must log in.
Revision history for this message
PkLab.net (pklab) wrote :

Hallo,
in your proposed branch the file survey/report/survey_browse_response.py calls to object registry = openerp.registry(cr.dbname) but I can't find the object openerp.registry in Trunk v.7.0.

Unmerged revisions

9063. By Chirag Dodiya(OpenERP)

[FIX]traceback when completing the survey

9062. By Chirag Dodiya(OpenERP)

[IMP]Improved yml test case

9061. By Chirag Dodiya(OpenERP)

[IMP]Improved code to solve traceback

9060. By Chirag Dodiya(OpenERP)

[FIX]Traceback: KeyError: active_ids

9059. By Chirag Dodiya(OpenERP)

[FIX]added applicant field in survey response and improved code to print interview

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hr_evaluation/test/test_hr_evaluation.yml'
2--- hr_evaluation/test/test_hr_evaluation.yml 2013-10-27 12:31:04 +0000
3+++ hr_evaluation/test/test_hr_evaluation.yml 2014-01-28 05:13:09 +0000
4@@ -46,7 +46,7 @@
5 interview_obj = self.pool.get('hr.evaluation.interview')
6 interview_ids = interview_obj.search(cr, uid, [('evaluation_id','=', ref('hr_evaluation_evaluation_0'))])
7 assert len(interview_ids), "Interview evaluation survey not created"
8- ctx = {'active_model':'hr.evaluation.interview', 'active_id': interview_ids[0], 'active_ids': [interview_ids], 'survey_id': ref("survey_2")}
9+ ctx = {'active_model':'hr.evaluation.interview', 'active_id': interview_ids[0], 'active_ids': interview_ids, 'survey_id': ref("survey_2")}
10 name_id = name_wiz_obj.create(cr, uid, {'survey_id': ref("survey_2")})
11 ctx ["sur_name_id"] = name_id
12 self.create(cr, uid, {str(ref("survey_question_2")) +"_" +str(ref("survey_answer_1")) + "_multi" :'tpa',
13
14=== modified file 'survey/report/survey_browse_response.py'
15--- survey/report/survey_browse_response.py 2013-11-27 15:32:57 +0000
16+++ survey/report/survey_browse_response.py 2014-01-28 05:13:09 +0000
17@@ -196,7 +196,7 @@
18 if datas.has_key('form') and datas['form'].has_key('response_ids'):
19 response_id = datas['form']['response_ids']
20 elif context.has_key('response_id') and context['response_id']:
21- response_id = [int(context['response_id'][0])]
22+ response_id = context['response_id']
23 else:
24 response_id = surv_resp_obj.search(cr, uid, [('survey_id', 'in', ids)])
25
26
27=== modified file 'survey/survey.py'
28--- survey/survey.py 2013-10-27 12:31:04 +0000
29+++ survey/survey.py 2014-01-28 05:13:09 +0000
30@@ -111,15 +111,19 @@
31 context = {}
32 datas = {}
33 if 'response_id' in context:
34- response_id = context.get('response_id', 0)
35- datas['ids'] = [context.get('survey_id', 0)]
36+ if context.get('response_id')[0] == 0:
37+ response_id = self.pool.get('survey.response').search(cr, uid, [('applicant', '=', ids[0])], context=context)
38+ datas['ids'] = [context.get('survey_id', 0)]
39+ else:
40+ response_id = context.get('response_id', 0)
41+ datas['ids'] = [context.get('response_id', 0)]
42 else:
43 response_id = self.pool.get('survey.response').search(cr, uid, [('survey_id','=', ids)], context=context)
44 datas['ids'] = ids
45 page_setting = {'orientation': 'vertical', 'without_pagebreak': 0, 'paper_size': 'letter', 'page_number': 1, 'survey_title': 1}
46 report = {}
47 if response_id and response_id[0]:
48- context.update({'survey_id': datas['ids']})
49+ context.update({'survey_id': datas['ids'], 'response_id':response_id})
50 datas['form'] = page_setting
51 datas['model'] = 'survey.print.answer'
52 report = {
53@@ -658,6 +662,7 @@
54 'question_ids' : fields.one2many('survey.response.line', 'response_id', 'Answer'),
55 'state' : fields.selection([('done', 'Finished '),('skip', 'Not Finished')], \
56 'Status', readonly=True),
57+ 'applicant': fields.integer("Applicant"),
58 }
59 _defaults = {
60 'state' : lambda * a: "skip",
61
62=== modified file 'survey/wizard/survey_answer.py'
63--- survey/wizard/survey_answer.py 2013-10-27 12:31:04 +0000
64+++ survey/wizard/survey_answer.py 2014-01-28 05:13:09 +0000
65@@ -400,7 +400,7 @@
66 result['context'] = context
67 else:
68 survey_obj.write(cr, uid, survey_id, {'tot_comp_survey' : sur_rec.tot_comp_survey + 1})
69- sur_response_obj.write(cr, uid, [sur_name_read.response], {'state' : 'done'})
70+ sur_response_obj.write(cr, uid, [int(sur_name_read.response)], {'state' : 'done'})
71
72 # mark the survey request as done; call 'survey_req_done' on its actual model
73 if context.get('active_model') in self.pool:
74@@ -593,13 +593,13 @@
75 response_id = 0
76
77 if not sur_name_read['response']:
78- response_id = surv_all_resp_obj.create(cr, uid, {'response_type':'link', 'user_id':uid, 'date_create':datetime.datetime.now(), 'survey_id' : context['survey_id']})
79+ response_id = surv_all_resp_obj.create(cr, uid, {'response_type':'link', 'user_id':uid, 'date_create':datetime.datetime.now(), 'survey_id' : context['survey_id'], 'applicant':context.get('active_ids',[0])[0]})
80 surv_name_wiz.write(cr, uid, [context.get('sur_name_id', False)], {'response' : tools.ustr(response_id)})
81 else:
82 response_id = int(sur_name_read['response'])
83
84 if response_id not in surv_all_resp_obj.search(cr, uid, []):
85- response_id = surv_all_resp_obj.create(cr, uid, {'response_type':'link', 'user_id':uid, 'date_create':datetime.datetime.now(), 'survey_id' : context.get('survey_id',False)})
86+ response_id = surv_all_resp_obj.create(cr, uid, {'response_type':'link', 'user_id':uid, 'date_create':datetime.datetime.now(), 'survey_id' : context.get('survey_id',False), 'applicant':context.get('active_ids',[0])[0]})
87 surv_name_wiz.write(cr, uid, [context.get('sur_name_id',False)], {'response' : tools.ustr(response_id)})
88
89 #click first time on next button then increemnet on total start suvey

Subscribers

People subscribed via source and target branches

to all changes: