diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index 72e5d244269..a97e1be494c 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -128,6 +128,7 @@ Creates a dashboard for CRM that includes: 'test/test_crm_stage_changes.yml', 'test/test_crm_recurrent_meeting_case2.yml', 'test/test_crm_lead_case2.yml', + 'test/test_crm_opportunity_case2.yml', ], 'installable': True, 'active': False, diff --git a/addons/crm/test/test_crm_opportunity_case2.yml b/addons/crm/test/test_crm_opportunity_case2.yml new file mode 100644 index 00000000000..5069c4d826e --- /dev/null +++ b/addons/crm/test/test_crm_opportunity_case2.yml @@ -0,0 +1,45 @@ +- | + I start by creating a new Opportunity. And I select partner for opportunity. + I can see that after selecting partner his contact and email is automatically filled. +- + !record {model: crm.lead, id: crm_opportunity_demotestopportunity}: + email_from: info@balmerinc.be + name: 'Demo Test Opportunity' + partner_address_id: base.res_partner_address_1 + partner_id: base.res_partner_9 + probability: 1.0 + categ_id: crm.categ_oppor2 + section_id: crm.section_sales_department + type: opportunity +- + I check that the opportunity is in 'New' state. +- + !assert {model: crm.lead, id: crm_opportunity_demotestopportunity, string: Opportunity in Draft}: + - state == "draft" +- + I open opportunity by click on "Open" button, +- + !python {model: crm.lead}: | + self.case_open(cr, uid, [ref("crm_opportunity_demotestopportunity")]) +- + I change partner of the opportunity. +- + !python {model: crm.lead}: | + self.onchange_partner_id(cr, uid, [ref("crm_opportunity_demotestopportunity")], ref("base.res_partner_agrolait")) + +- + I change Contact Detail of the opportunity. +- + !python {model: crm.lead}: | + self.onchange_partner_address_id(cr, uid,[ref("crm_opportunity_demotestopportunity")], ref("base.res_partner_address_8invoice")) + +- + I change Opportunity to Won State. +- + !python {model: crm.lead}: | + self.case_mark_won(cr, uid, [ref("crm_opportunity_demotestopportunity")]) +- + I check that the opportunity is in 'Done' state. +- + !assert {model: crm.lead, id: crm_opportunity_demotestopportunity, string: Opportunity is Won}: + - state == "done"