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
27 - name: '[KEYA] Keyboard - AZERTY'
29 product_uom: product.product_uom_unit
32 product_id: product.product_product_24
36 Then I click on the 'Ok' button of wizard
38 !python {model: crm.make.sale}: |
39 self.makeOrder(cr, uid, [ref("crm_make_sale_0")], {"lang": "en_US", "tz": False,
40 "active_model": "crm.lead", "section_id": False, "default_type": "opportunity",
41 "search_default_user_id": 1, "search_default_current": 1, "active_ids": [1],
44 I verify that a sale order has been generated from an opportunity
46 !python {model: sale.order}: |
47 crm_obj = self.pool.get('crm.lead')
48 crm = self.browse(cr, uid, ref("crm_lead_opportunity0"))
49 so = self.search(cr, uid, [('origin','=', 'Opportunity: %s' % str(crm.id))])
50 assert so, "Sale order has not been created "