From aef95be470d8b889fb4ede1131f000f30ad31abc Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Wed, 12 Oct 2011 15:31:34 +0530 Subject: [PATCH] [ADD] crm: 1) Added new crm_lead_to_opportunity.yml bzr revid: ron@tinyerp.com-20111012100134-gueog210ck07yhx6 --- addons/crm/__openerp__.py | 3 +- .../test/process/crm_lead_to_opportunity.yml | 36 +++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 addons/crm/test/process/crm_lead_to_opportunity.yml diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index 05ed350bea1..d7256360d40 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -119,7 +119,8 @@ Creates a dashboard for CRM that includes: 'crm_phonecall_demo.xml', ], 'test': [ - 'test/process/process_crm_lead.yml', + 'test/process/crm_lead_open.yml', + 'test/process/crm_lead_to_opportunity.yml', 'test/process/cancle_crm_lead.yml', 'test/process/process_crm_meeting.yml', 'test/test_crm_opportunity.yml', diff --git a/addons/crm/test/process/crm_lead_to_opportunity.yml b/addons/crm/test/process/crm_lead_to_opportunity.yml new file mode 100644 index 00000000000..2c1ccc65bfb --- /dev/null +++ b/addons/crm/test/process/crm_lead_to_opportunity.yml @@ -0,0 +1,36 @@ +- + As the lead seems to be a real business opportunity, I will convert it to a partner + and a business opportunity. +- + !record {model: crm.lead2opportunity.partner, id: crm_lead2opportunity_partner_create_1}: + action: 'exist' +- + Create opportunity based on exiting partner +- + !python {model: crm.lead2opportunity.partner}: | + self.action_apply(cr, uid, [ref("crm_lead2opportunity_partner_create_1")], {'active_ids': [ref("crm_case_qrecorp0")], 'active_id': ref("crm_case_qrecorp0")}) +- + In order to test lead, i will test to lead is converted to opportunity. +- + !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: Lead is not converted on opportunity}: + - type == 'opportunity' +- + Finally, i won this lead, so i will close this lead. +- + !python {model: crm.lead}: | + self.case_mark_won(cr, uid, [ref("crm_case_qrecorp0")]) +- + In order to test lead, it is close or not. +- + !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: Lead in done state}: + - state == "done" +- + After won this lead probability is 100. +- + !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: Probability is equal to 100}: + - probability == 100.0 +- + In order to test stage of opportunity after win, i will test stage of opportunity. +- + !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: stage of opportunity is win}: + - stage_id.name == "Won"