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 "Demo Sales Team" with No Unlink.
6 Creating a crm.case.section record
8 !record {model: crm.case.section, id: crm_case_section_demosalesteam}:
10 complete_name: Demo Sales Team
23 resource_calendar_id: resource.timesheet_group1
24 parent_id: crm.section_sales_department
26 !record {model: res.users, id: res_users_usercrm0}:
27 context_section_id: crm_case_section_demosalesteam
29 Creating a new lead "Demo Customer" and I provide an address to this
30 demo customer and email "info@democustomer.com" and Also "Demo Sales Team".
32 !record {model: crm.lead, id: crm_lead_democustomer}:
33 email_from: info@democustomer.com
35 partner_name: NotSoTinySARL
36 phone: (+32).81.81.37.00
37 mobile: (+32).81.81.37.00
38 section_id: crm_case_section_demosalesteam
42 I check that the lead is in 'draft' state,
44 !assert {model: crm.lead, id: crm_lead_democustomer, string: Lead in Draft}:
47 I assigning contact detail to the Lead "Demo Customer" without address.
49 !python {model: crm.lead}: |
50 self.onchange_partner_address_id(cr, uid, ref("crm_lead_democustomer"), None, email=False)
53 I assigning contact detail to the Lead "Demo Customer" with address.
55 !python {model: crm.lead}: |
56 self.onchange_partner_address_id(cr, uid, ref("crm_lead_democustomer"), ref("base.res_partner_address_notsotinysarl0"), email=False)
59 I selecting email "Opt-out" option for the "Demo Customer" Lead.
61 !python {model: crm.lead}: |
62 self.on_change_optout(cr, uid, ref("crm_lead_democustomer"), True)
65 Now I change the Opt-out to Opt-in to show email receive preference.
67 !python {model: crm.lead}: |
68 self.on_change_optin(cr, uid, ref("crm_lead_democustomer"), True)
70 I open lead by click on "Open" button,
72 !python {model: crm.lead}: |
73 self.case_open(cr, uid, [ref("crm_lead_democustomer")])
75 I check that lead "Demo Customer" is now in 'open' state.
77 !assert {model: crm.lead, id: crm_lead_democustomer, string: Lead in open state}:
80 Now i reset the lead "Demo Customer".
82 !python {model: crm.lead}: |
83 self.case_reset(cr, uid, [ref("crm_lead_democustomer")])
85 I again opening lead by click on "Open" button,
87 !python {model: crm.lead}: |
88 self.case_open(cr, uid, [ref("crm_lead_democustomer")])
90 I setting stage "New" for the lead "Demo Customer".
92 !python {model: crm.lead}: |
93 self.stage_next(cr, uid, [ref("crm_lead_democustomer")], context={'stage_type': 'lead'})
95 I try to Unlink the Lead "Demo Customer" demo Lead
97 !python {model: crm.lead}: |
99 self.unlink(cr, uid, [ref("crm_lead_democustomer")])
103 I setting Lead "Demo Customer" to Pending State
105 !python {model: crm.lead}: |
106 self.case_pending(cr, uid, [ref("crm_lead_democustomer")])
108 I check that lead "Demo Customer" is now in 'Pending' state.
110 !assert {model: crm.lead, id: crm_lead_democustomer, string: Lead in Pending state}:
113 Now i Escalate the Lead "Demo Customer" Parent "Sales Team".
115 !python {model: crm.lead}: |
116 self.case_escalate(cr, uid, [ref("crm_lead_democustomer")])
118 Now i add Internal Note Saying Escalated Reason
119 Creating a crm.add.note record
121 !record {model: crm.add.note, id: crm_add_note_0}:
122 body: Sales Lead Has Been Escalated Due to Some Technical reason to the parent 'Sales
126 I click aa note button to attach the record
128 !python {model: crm.add.note}: |
129 context['active_model'] = "crm.lead"
130 context['active_ids'] = [ref("crm_lead_democustomer")]
131 self.action_add(cr, uid, [ref("crm_add_note_0")], context=context)
134 Now i Copying this lead "Demo Customer" to New Lead.
136 !python {model: crm.lead}: |
137 self.copy(cr, uid, ref("crm_lead_democustomer"))
139 Checking the Lead Copied or Not.
141 !python {model: crm.lead}: |
142 sid = self.search(cr, uid, [('name', '=', 'Demo Customer'),('state', '=', 'draft')])
144 raise AssertionError("Lead is not copied Successfully")