2 In order to test the CRM in OpenERP,
3 I will do a customer qualification process that
4 starts with a fist contact with a customer (a lead), which will be converted to a
5 business opportunity and a partner.
7 In order to test the flow, I create a two new users "user_crm" and
8 I assign the group "salesman".
10 !record {model: res.users, id: res_users_usercrm0}:
11 company_id: base.main_company
13 context_section_id: crm.section_sales_department
21 I start by creating a new lead "New Customer" and I provide an address to this
22 new customer, as well as an email "info@mycustomer.com".
24 !record {model: crm.lead, id: crm_lead_newcustomer0}:
25 email_from: info@mycustomer.com
27 partner_name: Capegemini
29 mobile: (333) 715-1450
30 section_id: crm.section_sales_department
33 I check that the lead is in 'draft' state,
35 !assert {model: crm.lead, id: crm_lead_newcustomer0, string: Lead in Draft}:
38 I open lead by click on "Open" button,
40 !python {model: crm.lead}: |
41 self.case_open(cr, uid, [ref("crm_lead_newcustomer0")])
43 I check that lead is now in 'open' state.
45 !assert {model: crm.lead, id: crm_lead_newcustomer0, string: Lead in open state}:
49 As the lead seems to be a real business opportunity, I will convert it to a
51 and a business opportunity by clicking on the "Convert" button.
53 !python {model: crm.lead}: |
54 lead = self.browse(cr, uid, ref('crm_lead_newcustomer0'))
55 action = self.convert_opportunity(cr, uid, [ref("crm_lead_newcustomer0")], {'active_ids': [ref("crm_lead_newcustomer0")]})
56 assert action['res_model'] == 'crm.lead2opportunity.partner'
59 Now, select "create a new partner" option in this wizard.
61 !record {model: crm.lead2opportunity.partner, id: crm_lead2opportunity_partner_create_0}:
64 I click on "Continue" button of this wizard.
66 !python {model: crm.lead2opportunity.partner}: |
67 self.make_partner(cr, uid, [ref("crm_lead2opportunity_partner_create_0")], {'active_ids': [ref("crm_lead_newcustomer0")]})
69 Now, I give value to this wizard field.
71 !record {model: crm.lead2opportunity, id: crm_lead2opportunity_stonage_0}:
76 Then, Click on "Create Opportunity" button of this wizard.
78 !python {model: crm.lead2opportunity}: |
79 self.action_apply(cr, uid, [ref('crm_lead2opportunity_stonage_0')], {'active_id': ref('crm_lead_newcustomer0')})
82 I can check that a lead and a business opportunity is now assigned to this
85 # !python {model: crm.lead, id: crm_lead_newcustomer0}:
86 # - opportunity_id == False
89 I check that the partner associated to this lead as the same country, phone number
90 and name than the opportunity.
92 !python {model: crm.lead}: |
93 lead = self.browse(cr, uid, ref("crm_lead_newcustomer0"))
94 obj_opportunity = self.pool.get('crm.lead')
95 ids = obj_opportunity.search(cr, uid, [('name', '=', lead.partner_name)])
96 opportunity = obj_opportunity.browse(cr, uid, ids)[0]
97 assert lead.partner_name == opportunity.partner_id.name
98 assert lead.phone == opportunity.phone
102 # yaml is also not working smpt server and send new email.
105 I configure with smtp server.
107 And I communicate with lead through send New mail to Lead using it email address from user which are loged.
109 I check that communication history generated when send email to lead.
111 Then, I add a cc which receive copy of future communication between partner and users by mail.
114 I Reply to last Email to lead with some document attached.and check that communication history generated or not.