2 In order to test the sale_crm module in the Open-ERP,
3 I create an opportunity and create a sale order through 'Convert to Sale' wizard .
5 I create an opportunity
7 !record {model: crm.lead, id: crm_lead_opportunity0}:
10 planned_revenue: 50000.0
12 partner_address_id: base.res_partner_address_7
13 partner_id: base.res_partner_4
16 section_id: crm.section_sales_department
18 categ_id: crm.categ_oppor1
20 Then I click on the 'Convert to Sale' wizard
22 I place a sale order for product keyboard having quantity 50
24 !record {model: crm.make.sale, id: crm_make_sale_0}:
25 partner_id: base.res_partner_4
28 Then I click on the 'Ok' button of wizard
30 !python {model: crm.make.sale}: |
31 crm_obj = self.pool.get('crm.lead')
32 crm = crm_obj.browse(cr, uid, ref("crm_lead_opportunity0"))
33 self.makeOrder(cr, uid, [ref("crm_make_sale_0")], {"lang": "en_US", "tz": False,
34 "active_model": "crm.lead", "section_id": "crm.section_sales_department", "default_type": "opportunity",
35 "search_default_user_id": 1, "search_default_current": 1, "active_ids": [crm.id],
38 I verify that a sale order has been generated from an opportunity
40 !python {model: crm.lead}: |
41 crm = self.browse(cr, uid, ref("crm_lead_opportunity0"))
42 assert (crm.ref),("sale order has not been created")