From a198350e582750f4e8c4bfc987ff8d8942aa549f Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Fri, 23 Sep 2011 12:09:49 +0530 Subject: [PATCH] [IMP]remove repeated code bzr revid: dbr@tinyerp.com-20110923063949-4c6oymzdaick8pav --- addons/crm/test/test_crm_lead.yml | 16 ---------------- addons/crm/test/test_crm_phonecall.yml | 16 ++++++---------- addons/crm_fundraising/test/test_crm_fund.yml | 15 ++++++++++++++- 3 files changed, 20 insertions(+), 27 deletions(-) diff --git a/addons/crm/test/test_crm_lead.yml b/addons/crm/test/test_crm_lead.yml index 92c01b5d8ea..830a21ca807 100644 --- a/addons/crm/test/test_crm_lead.yml +++ b/addons/crm/test/test_crm_lead.yml @@ -129,22 +129,6 @@ - !python {model: crm.lead2opportunity.partner.mass}: | self.mass_convert(cr, uid, [ref("crm_lead2opportunity_partner_mass0")],{'active_ids': [ref("crm_lead_newcustomer0")], 'active_id': ref("crm_lead_newcustomer0")}) - -- - I create notes. -- - !record {model: crm.add.note, id: crm_add_note0}: - {} -- - Then, try to add notes. -- - !python {model: crm.add.note}: | - try: - context.update({'active_model': "crm.lead"}) - model = ref("crm_lead_newcustomer0") or False - self.action_add(cr, uid, [ref("crm_add_note0")],context) - except: - pass - I close lead by click on "close" button. - diff --git a/addons/crm/test/test_crm_phonecall.yml b/addons/crm/test/test_crm_phonecall.yml index 7a9c367b296..0754a5b9544 100644 --- a/addons/crm/test/test_crm_phonecall.yml +++ b/addons/crm/test/test_crm_phonecall.yml @@ -14,7 +14,7 @@ partner_id: base.res_partner_9 - - I click on "Continue" button of this wizard. + I click on "Continue" button of this wizard and make partner. - !python {model: crm.phonecall2partner}: | @@ -31,18 +31,16 @@ partner_id: base.res_partner_9 planned_revenue: 0.0 probability: 0.0 -- - I click on "Convert" button of this wizard. -- - !python {model: crm.phonecall2opportunity}: | - self.action_apply(cr, uid, [ref("crm_phonecall2opportunity_interviewcall0")], {"active_id": ref("crm_phonecall_interviewcall0")}) - - | I can see that a business opportunity is now assigned to this phonecall - !assert {model: crm.phonecall, id: crm_phonecall_interviewcall0}: - opportunity_id != False - +- + I click on "Convert" button of this wizard. +- + !python {model: crm.phonecall2opportunity}: | + self.action_apply(cr, uid, [ref("crm_phonecall2opportunity_interviewcall0")], {"active_id": ref("crm_phonecall_interviewcall0")}) - | And I check that the phonecall and the newly created business opportunity is linked to same partner. @@ -50,10 +48,8 @@ !python {model: crm.phonecall}: | obj_phonecall = self.browse(cr, uid, ref('crm_phonecall_interviewcall0')) ids = self.pool.get('crm.lead').search(cr, uid, [('name', '=', obj_phonecall.opportunity_id.name)]) - #self.case_reset(cr, uid, ids) obj_opp = self.pool.get('crm.lead').browse(cr, uid, ids)[0] assert obj_phonecall.partner_id == obj_opp.partner_id - - | I schedule Meeting on this current phonecall by clicking on "schedule Meeting". diff --git a/addons/crm_fundraising/test/test_crm_fund.yml b/addons/crm_fundraising/test/test_crm_fund.yml index a9207e534f0..ef81afeb563 100644 --- a/addons/crm_fundraising/test/test_crm_fund.yml +++ b/addons/crm_fundraising/test/test_crm_fund.yml @@ -25,8 +25,21 @@ - !python {model: crm.fundraising}: | self.case_open(cr, uid, [ref('crm_fundraising_donationforbookstopoorschoolchildren0')]) +- + I create the message regarding the all details of fundraising. +- + !python {model: crm.fundraising}: | + msg = { + 'subject': 'fundraising_email', + 'body_text': 'fundraising details', + 'from': 'Administrator ', + 'priority':'3', + } + context = None + self.message_new(cr, uid,msg,context) + - | - I can close Funds by click on "Done" button. + After a request via email now I close this fundraising Request by clicking on "Done" button. - !python {model: crm.fundraising}: | self.case_close(cr, uid, [ref('crm_fundraising_donationforbookstopoorschoolchildren0')])