2 In order to do complete test the CRM in OpenERP,
3 I will create new full configured record and carry test on it.
5 I Start by creating "Test Sales Team" with No Unlink.
6 I create a crm.case.section record.
8 !record {model: crm.case.section, id: crm_case_section_demosalesteam}:
10 complete_name: Test Sales Team
23 resource_calendar_id: resource.timesheet_group1
24 parent_id: crm.section_sales_department
26 I assign segmentation.
28 !record {model: res.users, id: res_users_usercrm0}:
29 context_section_id: crm_case_section_demosalesteam
31 I create a new lead "Test Customer" and I provide an address to this
32 demo customer and email "info@democustomer.com" and Also "Test Sales Team".
34 !record {model: crm.lead, id: crm_lead_democustomer}:
35 email_from: info@democustomer.com
37 partner_name: NotSoTinySARL
38 phone: (+32).81.81.37.00
39 mobile: (+32).81.81.37.00
40 section_id: crm_case_section_demosalesteam
44 I check that the lead is in 'draft' state.
46 !assert {model: crm.lead, id: crm_lead_democustomer, string: Lead in Draft}:
51 !record {model: crm.case.categ, id: crm_case_categ0}:
52 name: crm_case_section_demosalesteam
53 section_id: crm_case_section_demosalesteam
55 I assigning contact detail to the Lead "Test Customer" without address.
57 !python {model: crm.lead}: |
58 self.onchange_partner_address_id(cr, uid, ref("crm_lead_democustomer"), None, email=False)
61 I assigning contact detail to the Lead "Test Customer" with address.
63 !python {model: crm.lead}: |
64 self.onchange_partner_address_id(cr, uid, ref("crm_lead_democustomer"), ref("base.res_partner_address_notsotinysarl0"), email=False)
67 I selecting email "Opt-out" option for the "Test Customer" Lead.
69 !python {model: crm.lead}: |
70 self.on_change_optout(cr, uid, ref("crm_lead_democustomer"), True)
73 I change the Opt-out to Opt-in to show email receive preference.
75 !python {model: crm.lead}: |
76 self.on_change_optin(cr, uid, ref("crm_lead_democustomer"), True)
78 I open lead by click on "Open" button.
80 !python {model: crm.lead}: |
81 self.case_open(cr, uid, [ref("crm_lead_democustomer")])
83 I check that lead "Test Customer" is now in 'open' state.
85 !assert {model: crm.lead, id: crm_lead_democustomer, string: Lead in open state}:
88 I reset the lead "Test Customer".
90 !python {model: crm.lead}: |
91 self.case_reset(cr, uid, [ref("crm_lead_democustomer")])
93 I again opening lead by click on "Open" button.
95 !python {model: crm.lead}: |
96 self.case_open(cr, uid, [ref("crm_lead_democustomer")])
98 I setting stage "New" for the lead "Test Customer".
100 !python {model: crm.lead}: |
101 self.stage_next(cr, uid, [ref("crm_lead_democustomer")], context={'stage_type': 'lead'})
103 I try to Unlink the Lead "Test Customer" demo Lead.
105 !python {model: crm.lead}: |
107 self.unlink(cr, uid, [ref("crm_lead_democustomer")])
111 I setting Lead "Test Customer" to Pending State.
113 !python {model: crm.lead}: |
114 self.case_pending(cr, uid, [ref("crm_lead_democustomer")])
116 I check that lead "Test Customer" is now in 'Pending' state.
118 !assert {model: crm.lead, id: crm_lead_democustomer, string: Lead in Pending state}:
121 I Escalate the Lead "Test Customer" Parent "Sales Team".
123 !python {model: crm.lead}: |
124 self.case_escalate(cr, uid, [ref("crm_lead_democustomer")])
126 I add Internal Note Saying Escalated Reason.
128 !record {model: crm.add.note, id: crm_add_note_0}:
129 body: Sales Lead Has Been Escalated Due to Some Technical reason to the parent 'Sales
133 I click a note button to attach the record.
135 !python {model: crm.add.note}: |
136 context['active_model'] = "crm.lead"
137 context['active_ids'] = [ref("crm_lead_democustomer")]
138 self.action_add(cr, uid, [ref("crm_add_note_0")], context=context)
141 I Copying this lead "Test Customer" to New Lead.
143 !python {model: crm.lead}: |
144 self.copy(cr, uid, ref("crm_lead_democustomer"))
146 I checking the Lead Copied or Not.
148 !python {model: crm.lead}: |
149 sid = self.search(cr, uid, [('name', '=', 'Test Customer'),('state', '=', 'draft')])
151 raise AssertionError("Lead is not copied Successfully")