Files
odoo_source/addons/crm/test/test_crm_opportunity_case2.yml
T

46 lines
1.5 KiB
YAML

- |
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"