[MERGE] lp:~xrg/openobject-addons/trunk-patch18
[odoo/odoo.git] / addons / sale_crm / test / sale_crm.yml
1 -
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 .
4 -
5   I create an opportunity
6 -
7   !record {model: crm.lead, id: crm_lead_opportunity0}:
8     country_id: base.be
9     name: Opportunity-1
10     planned_revenue: 50000.0
11     probability: 70.0
12     partner_address_id: base.res_partner_address_7
13     partner_id: base.res_partner_4
14     planned_revenue: 0.0
15     probability: 0.0
16     section_id: crm.section_sales_department
17     type: opportunity
18     categ_id: crm.categ_oppor1
19 -
20   Then I click on the 'Convert to Sale' wizard
21 -
22   I place a sale order for product keyboard having quantity 50
23 -
24   !record {model: crm.make.sale, id: crm_make_sale_0}:
25     partner_id: base.res_partner_4
26     shop_id: sale.shop
27 -
28   Then I click on the 'Ok' button of wizard
29 -
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],
36       "active_id": crm.id})
37 -
38   I verify that a sale order has been generated from an opportunity
39 -
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")