From e8f2c2e45aec3d8a316bab21a18702b1ae7b0b40 Mon Sep 17 00:00:00 2001 From: "Harry (OpenERP)" Date: Thu, 1 Dec 2011 16:41:01 +0530 Subject: [PATCH] [IMP] sale_crm: improve yml bzr revid: hmo@tinyerp.com-20111201111101-n7tyvgkkybddpx46 --- addons/sale_crm/test/sale_crm.yml | 39 ++++++------------------------- 1 file changed, 7 insertions(+), 32 deletions(-) diff --git a/addons/sale_crm/test/sale_crm.yml b/addons/sale_crm/test/sale_crm.yml index cc75b9e415c..e85cf2cb7ba 100644 --- a/addons/sale_crm/test/sale_crm.yml +++ b/addons/sale_crm/test/sale_crm.yml @@ -1,42 +1,17 @@ -- - In order to test the sale_crm module in the Open-ERP, - I create an opportunity and create a sale order through 'Convert to Sale' wizard . -- - I create an opportunity -- - !record {model: crm.lead, id: crm_lead_opportunity0}: - country_id: base.be - name: Opportunity-1 - planned_revenue: 50000.0 - probability: 70.0 - partner_address_id: base.res_partner_address_7 - partner_id: base.res_partner_4 - planned_revenue: 0.0 - probability: 0.0 - section_id: crm.section_sales_department - type: opportunity - categ_id: crm.categ_oppor1 -- - Then I click on the 'Convert to Sale' wizard -- - I place a sale order for product keyboard having quantity 50 - !record {model: crm.make.sale, id: crm_make_sale_0}: partner_id: base.res_partner_4 - shop_id: sale.shop - - Then I click on the 'Ok' button of wizard + I convert opportunity into "Quotation". - !python {model: crm.make.sale}: | - crm_obj = self.pool.get('crm.lead') - crm = crm_obj.browse(cr, uid, ref("crm_lead_opportunity0")) - self.makeOrder(cr, uid, [ref("crm_make_sale_0")], {"lang": "en_US", "tz": False, - "active_model": "crm.lead", "section_id": "crm.section_sales_department", "default_type": "opportunity", - "search_default_user_id": 1, "search_default_current": 1, "active_ids": [crm.id], + crm_lead = self.pool.get('crm.lead') + crm = crm_lead.browse(cr, uid, ref("crm.crm_case_construstazunits0")) + self.makeOrder(cr, uid, [ref("crm_make_sale_0")], {"active_ids": [crm.id], "active_id": crm.id}) - - I verify that a sale order has been generated from an opportunity + I check that reference number of "Quotation" in opportunity. - !python {model: crm.lead}: | - crm = self.browse(cr, uid, ref("crm_lead_opportunity0")) - assert (crm.ref),("sale order has not been created") + crm = self.browse(cr, uid, ref("crm.crm_case_construstazunits0")) + assert crm.ref, "Quotation has not been created."