From 4ffbf5fc8583e04852a69ab4f61b487f6e1e6848 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Mon, 17 Oct 2011 18:14:33 +0530 Subject: [PATCH] [ADD] crm: Added new yml merge_opportunity.yml and also updated __openerp__.py bzr revid: ron@tinyerp.com-20111017124433-21wwyc3yvs4qs2ca --- addons/crm/__openerp__.py | 1 + addons/crm/test/process/merge_opportunity.yml | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 addons/crm/test/process/merge_opportunity.yml diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index 7b11d12cede..965222976aa 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -121,6 +121,7 @@ Creates a dashboard for CRM that includes: 'test': [ 'test/process/lead_open.yml', 'test/process/lead2opportunity_win_lost.yml', + 'test/process/merge_opportunity.yml', 'test/process/partner2opportunity.yml', 'test/process/cancel_lead.yml', 'test/process/meeting.yml', diff --git a/addons/crm/test/process/merge_opportunity.yml b/addons/crm/test/process/merge_opportunity.yml new file mode 100644 index 00000000000..2028c304276 --- /dev/null +++ b/addons/crm/test/process/merge_opportunity.yml @@ -0,0 +1,17 @@ +- + I have two opportunity ,so i merge this two Opportunities. +- + !python {model: crm.merge.opportunity}: | + op_ids=self.pool.get('crm.lead').browse(cr, uid, [ref('crm_case_bankwealthy2'), ref('crm_case_unifliege')]) + self.merge(cr, uid, op_ids) + +- + I test which two opportunity has been merged . +- + !python {model: crm.lead}: | + lead = self.browse(cr, uid, ref('crm_case_bankwealthy2')) + merge = 'Merged opportunities' in lead.message_ids[0].subject + assert merge,'Fail to create Merge opportunity' + assert lead.type == 'opportunity', 'Merged opportunity type not change!' + assert lead.partner_id.id == ref("base.res_partner_accent"), 'Partner missmatch!' + assert lead.stage_id.id == ref("stage_lead2"), 'Stage of probability is incorrect!'