odoo/addons/crm/test/process/lead2opportunity2win.yml

27 lines
1.1 KiB
YAML

-
Convert opportunity based on exiting partner.
-
!python {model: crm.lead}: |
self.convert_opportunity(cr, uid ,[ref("crm_case_qrecorp0")], ref("base.res_partner_agrolait"))
-
After converted in opportunity, I test that lead is converted to opportunity.
-
!python {model: crm.lead}: |
lead = self.browse(cr, uid, ref('crm_case_qrecorp0'))
assert lead.type == 'opportunity', 'Lead is not converted to opportunity!'
assert lead.partner_id.id == ref("base.res_partner_agrolait"), 'Partner missmatch!'
assert lead.stage_id.id == ref("stage_lead1"), 'Stage of opportunity is incorrect!'
-
Finally, i won this opportunity, so I close this opportunity.
-
!python {model: crm.lead}: |
self.case_mark_won(cr, uid, [ref("crm_case_qrecorp0")])
-
After wininng the opportunity , I test the opportunity.
-
!python {model: crm.lead}: |
lead = self.browse(cr, uid, ref('crm_case_qrecorp0'))
assert lead.state == 'done', 'Opportunity is not in done state!'
assert lead.stage_id.name == 'Won', ' Stage of Opportunity is not win!'
assert lead.probability == 100.0, 'probability revenue should not be 100.0!'