[ADD] crm: 1) Added yml partner2opportunity.yml,

2) Covered partner to opportunity scenario

bzr revid: ron@tinyerp.com-20111017094617-9ctr8c7liedjo2fh
This commit is contained in:
ron@tinyerp.com
2011-10-17 15:16:17 +05:30
parent 0625ab16fc
commit c656f53e81
2 changed files with 21 additions and 0 deletions
+1
View File
@@ -121,6 +121,7 @@ Creates a dashboard for CRM that includes:
'test': [
'test/process/lead_open.yml',
'test/process/lead2opportunity.yml',
'test/process/partner2opportunity.yml',
'test/process/cancel_lead.yml',
'test/process/meeting.yml',
'test/process/lead2_mass_convert_opportunity.yml',
@@ -0,0 +1,20 @@
- |
I will create opportunity by partner.
-
!record {model: crm.partner2opportunity, id: crm_partner2opportunity_id_0}:
name: BalmerInc S.A.
planned_revenue: 200.0
partner_id: base.res_partner_9
probability: 150.0
-
Convert partner to opportunity, i will test to convert opportunity is correct.
-
!python {model: crm.partner2opportunity}: |
opportunity = self.make_opportunity(cr, uid, [ref("crm_partner2opportunity_id_0")])
opportunity_rec = self.pool.get('crm.lead').browse(cr, uid, opportunity['res_id'])
assert opportunity_rec.type == 'opportunity', 'Lead is not converted to opportunity!'
assert opportunity_rec.planned_revenue == 200.0, 'Planned revenue should be 200!'
assert opportunity_rec.probability == 150.0, 'probability revenue should be 150!'
assert opportunity_rec.partner_id.id == ref("base.res_partner_9"), 'Partner missmatch!'
assert opportunity_rec.state == 'draft', 'Opportunity stage not in draft state'