2 In order to check the survey module in OpenERP I use the survey "Initial Partner Feedback".
4 I set the survey in Open state.
6 !python {model: survey}: |
7 sur = self.survey_open(cr, uid, [ref("survey_Initial_partner_feedback")], context)
9 I check state of survey is open or not.
11 !assert {model: survey, id: survey_Initial_partner_feedback, severity: error, string: Survey should be in open state}:
14 I check that the survey is reopened or not.
16 !python {model: survey}: |
17 self.survey_cancel(cr, uid, [ref('survey_Initial_partner_feedback')],context)
18 self.survey_open(cr, uid, [ref('survey_Initial_partner_feedback')],context)
20 I check that state of survey is open or not.
22 !assert {model: survey, id: survey_Initial_partner_feedback, severity: error, string: Survey should be in open state}:
25 I set the state of the survey open.
27 !python {model: survey}: |
28 sur = self.survey_open(cr, uid, [ref("survey_Initial_partner_feedback")], context)
30 In order to print the survey I click on Print.
32 !python {model: survey.print}: |
33 id = self.create(cr, uid, {'survey_ids': [(6,0,[ref('survey.survey_Initial_partner_feedback')])]})
34 self.action_next(cr, uid, [id], context)
36 In order to answer the survey I click on "Answer a Survey" wizard.
38 !python {model: survey.name.wiz}: |
39 id = self.create(cr, uid, {'survey_id': ref("survey_Initial_partner_feedback")})
40 self.action_next(cr, uid, [id], context)
42 I give the answer of the first and second page of the survey.
44 !python {model: survey.question.wiz}: |
45 ctx = {'active_model':'survey', 'active_id': ref('survey_Initial_partner_feedback'), 'active_ids': [ref('survey_Initial_partner_feedback')]}
46 self.fields_view_get(cr, uid, ref("survey.view_survey_question_message"),"form", context=ctx)
47 values = self.default_get(cr, uid, ['name'], ctx)
48 id = self.create(cr, uid, {str(ref("survey_initial_question_company_name")) +"_single" :'Tiny' , str(ref("survey_initial_question_company_size")) + "_selection" : int(ref("survey.survey_initial_question_company_size_51")), }, context)
49 self.action_next(cr, uid, [id], context)
50 id = self.create(cr, uid, {str(ref("survey_initial_question_contract_customers")) + "_selection" : int(ref("survey_initial_answer_sometimes")), str(ref("survey_initial_question_sell_to_your_customers")) + "_selection" : int(ref("survey_initial_answer_maintenance_contract")), }, context)
51 self.action_next(cr, uid, [id], context)
53 I print the answers of the survey.
55 !python {model: survey.browse.answer}: |
56 id = self.create(cr, uid, {'survey_id': ref('survey.survey_Initial_partner_feedback')})
57 self.action_next(cr, uid, [id], context)
59 I edit questions of the survey as per requirement.
61 !python {model: survey.question.wiz}: |
62 name_wiz_obj = self.pool.get('survey.name.wiz')
63 id = name_wiz_obj.create(cr, uid, {'survey_id': ref("survey_Initial_partner_feedback")})
64 ctx = {'active_model':'survey', 'active_id': ref('survey_Initial_partner_feedback'), 'active_ids': [ref('survey_Initial_partner_feedback')], 'question_id': ref('survey_initial_question_company_name'), 'page_number': -1,'sur_name_id': id}
65 self.action_edit_question(cr, uid, [ref('survey_initial_question_company_name')], context = ctx)
66 self.action_delete_question(cr, uid, [ref('survey_initial_question_company_name')], context = ctx)
67 self.action_new_question(cr, uid, [], context = ctx)
69 I edit Page of the survey as per requirement.
71 !python {model: survey.question.wiz}: |
72 name_wiz_obj = self.pool.get('survey.name.wiz')
73 id = name_wiz_obj.create(cr, uid, {'survey_id': ref("survey_Initial_partner_feedback")})
74 ctx = {'active_model':'survey', 'active_id': ref('survey_Initial_partner_feedback'), 'active_ids': [ref('survey_Initial_partner_feedback')], 'page_id': ref('survey_initial_page_Contracts'), 'sur_name_id': id}
75 self.action_edit_page(cr, uid, [ref('survey_initial_page_Contracts')], context = ctx)
76 self.action_delete_page(cr, uid, [ref('survey_initial_page_Contracts')], context = ctx)
77 self.action_new_page(cr, uid, [], context = ctx)
79 In order to send invitation to the users I click on "Send Invitation" wizard.
81 !python {model: survey.send.invitation}: |
82 context = {'active_model':'survey', 'active_id': ref('survey_Initial_partner_feedback'), 'active_ids': [ref('survey_Initial_partner_feedback')]}
83 values = self.default_get(cr, uid, ['mail_from', 'mail_subject', 'send_mail_existing', 'mail_subject_existing', 'mail', 'partner_ids', 'send_mail'], context)
84 values['mail_from'] = 'Surveyor'
85 new_id = self.create(cr, uid, values)
86 self.action_send(cr, uid, [new_id], context)
88 I set the value in "Total start survey" field.
90 !record {model: survey, id: survey_Initial_partner_feedback}:
93 I set the survey in Cancel state.
95 !python {model: survey}: |
96 self.survey_cancel(cr, uid, [ref("survey_Initial_partner_feedback")], context)
98 I check state of survey is cancel or not.
100 !assert {model: survey, id: survey_Initial_partner_feedback, severity: error, string: Survey should be in cancel state}:
103 I set the survey in close state.
105 !python {model: survey}: |
106 self.survey_close(cr, uid, [ref("survey_Initial_partner_feedback")], context)
108 I check state of Survey is close or not.
110 !assert {model: survey, id: survey_Initial_partner_feedback, severity: error, string: Survey should be in close state}: