[IMP]: crm: All changes done on phonecall2opportunity.yml

1) string improved because put more assert,
2) Removed code search by name Its done by id all

bzr revid: ron@tinyerp.com-20111013055209-3e6741omkojcs9vm
This commit is contained in:
ron@tinyerp.com
2011-10-13 11:22:09 +05:30
parent 0d3652a60b
commit 5cdcd1bf45
@@ -15,13 +15,11 @@
self.action_apply(cr, uid, [ref("crm_phonecall2opportunity_disc_openerp")], {"active_id": ref("crm_case_phone04")})
- |
For business And I check that the phonecall and the newly created business
opportunity is linked to same partner and also check with phonecall close or not.
opportunity is linked to same partner and also check with phonecall closed and opportunity
is on intial stage or not.
-
!python {model: crm.phonecall}: |
obj_phonecall = self.browse(cr, uid, ref('crm_case_phone04'))
ids = self.pool.get('crm.lead').search(cr, uid, [('name', '=', obj_phonecall.opportunity_id.name)])
obj_opp = self.pool.get('crm.lead').browse(cr, uid, ids)[0]
assert obj_phonecall.partner_id == obj_opp.partner_id, "created business opportunity is not linked to same partner"
assert obj_opp.stage_id.name == "New", "Converted opportunity is not in New stage"
assert obj_opp.stage_id.probability == 10.0, "Probability of opportunity is 10.0"
assert obj_phonecall.state == "done", "phonecall is held"
phonecall = self.browse(cr, uid, ref('crm_case_phone04'))
assert phonecall.partner_id.id == phonecall.opportunity_id.partner_id.id, "created business opportunity is not linked to same partner"
assert phonecall.opportunity_id.stage_id.id == ref("stage_lead1"), "Converted opportunity is not in Initial stage"
assert phonecall.state == "done", "phonecall is held"