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
27 Creating a new lead "Demo Customer" and I provide an address to this
28 demo customer and email "info@democustomer.com" and Also "Demo Sales Team".
30 !record {model: crm.lead, id: crm_lead_democustomer}:
31 email_from: info@democustomer.com
33 partner_name: NotSoTinySARL
34 phone: (+32).81.81.37.00
35 mobile: (+32).81.81.37.00
36 section_id: crm_case_section_demosalesteam
40 I check that the lead is in 'draft' state,
42 !assert {model: crm.lead, id: crm_lead_democustomer, string: Lead in Draft}:
45 I assigning contact detail to the Lead "Demo Customer".
47 !python {model: crm.lead}: |
48 self.onchange_partner_address_id(cr, uid, ref("crm_lead_democustomer"), ref("base.res_partner_address_notsotinysarl0"), email=False)
51 I selecting email "Opt-out" option for the "Demo Customer" Lead.
53 !python {model: crm.lead}: |
54 self.on_change_optout(cr, uid, ref("crm_lead_democustomer"), True)
57 Now I change the Opt-out to Opt-in to show email receive preference.
59 !python {model: crm.lead}: |
60 self.on_change_optin(cr, uid, ref("crm_lead_democustomer"), True)
62 I open lead by click on "Open" button,
64 !python {model: crm.lead}: |
65 self.case_open(cr, uid, [ref("crm_lead_democustomer")])
67 I check that lead "Demo Customer" is now in 'open' state.
69 !assert {model: crm.lead, id: crm_lead_democustomer, string: Lead in open state}:
72 Now i reset the lead "Demo Customer".
74 !python {model: crm.lead}: |
75 self.case_reset(cr, uid, [ref("crm_lead_democustomer")])
77 I again opening lead by click on "Open" button,
79 !python {model: crm.lead}: |
80 self.case_open(cr, uid, [ref("crm_lead_democustomer")])
82 I setting stage "New" for the lead "Demo Customer".
84 !python {model: crm.lead}: |
85 self.stage_next(cr, uid, [ref("crm_lead_democustomer")], context={'stage_type': 'lead'})
87 I try to Unlink the Lead "Demo Customer" demo Lead
89 !python {model: crm.lead}: |
91 self.unlink(cr, uid, [ref("crm_lead_democustomer")])
95 I setting Lead "Demo Customer" to Pending State
97 !python {model: crm.lead}: |
98 self.case_pending(cr, uid, [ref("crm_lead_democustomer")])
100 I check that lead "Demo Customer" is now in 'Pending' state.
102 !assert {model: crm.lead, id: crm_lead_democustomer, string: Lead in Pending state}:
105 Now i Escalate the Lead "Demo Customer" Parent "Sales Team".
107 !python {model: crm.lead}: |
108 self.case_escalate(cr, uid, [ref("crm_lead_democustomer")])
110 Now i add Internal Note Saying Escalated Reason
111 Creating a crm.add.note record
113 !record {model: crm.add.note, id: crm_add_note_0}:
114 body: Sales Lead Has Been Escalated Due to Some Technical reason to the parent 'Sales
118 I click aa note button to attach the record
120 !python {model: crm.add.note}: |
121 context['active_model'] = "crm.lead"
122 context['active_ids'] = [ref("crm_lead_democustomer")]
123 self.action_add(cr, uid, [ref("crm_add_note_0")], context=context)
126 Now i Copying this lead "Demo Customer" to New Lead.
128 !python {model: crm.lead}: |
129 self.copy(cr, uid, ref("crm_lead_democustomer"))
131 Checking the Lead Copied or Not.
133 !python {model: crm.lead}: |
134 sid = self.search(cr, uid, [('name', '=', 'Demo Customer'),('state', '=', 'draft')])
136 raise AssertionError("Lead is not copied Successfully")