From f10270c64a688964ac26b0e269b322f5750babd8 Mon Sep 17 00:00:00 2001 From: "Rucha (Open ERP)" Date: Mon, 30 Jul 2012 15:53:52 +0530 Subject: [PATCH] [IMP]: crm*: Improved xml_id of demo cases so it can be generic bzr revid: rpa@tinyerp.com-20120730102352-wv3g29qk556mx5zc --- addons/crm/crm_data.xml | 8 +- addons/crm/crm_lead_demo.xml | 74 +++++++++---------- addons/crm/test/process/cancel_lead.yml | 16 ++-- .../crm/test/process/lead2opportunity2win.yml | 34 ++++----- addons/crm/test/ui/crm_demo.yml | 6 +- addons/crm/test/ui/delete_lead.yml | 2 +- addons/crm/test/ui/duplicate_lead.yml | 2 +- .../test/partner_assign.yml | 6 +- addons/crm_todo/crm_todo_demo.xml | 6 +- addons/sale_crm/test/sale_crm.yml | 4 +- 10 files changed, 79 insertions(+), 79 deletions(-) diff --git a/addons/crm/crm_data.xml b/addons/crm/crm_data.xml index 88179428ab5..58699da94ce 100644 --- a/addons/crm/crm_data.xml +++ b/addons/crm/crm_data.xml @@ -1,16 +1,16 @@ - + website - + phone - + direct - + email diff --git a/addons/crm/crm_lead_demo.xml b/addons/crm/crm_lead_demo.xml index e375fee882e..6dc464013f3 100644 --- a/addons/crm/crm_lead_demo.xml +++ b/addons/crm/crm_lead_demo.xml @@ -5,7 +5,7 @@ Demo Leads --> - + lead @@ -24,7 +24,7 @@ - + lead @@ -44,7 +44,7 @@ - + lead @@ -62,7 +62,7 @@ - + lead @@ -78,7 +78,7 @@ - + lead @@ -97,7 +97,7 @@ - + @@ -117,7 +117,7 @@ - + @@ -135,7 +135,7 @@ - + @@ -153,7 +153,7 @@ - + @@ -171,7 +171,7 @@ - + @@ -181,7 +181,7 @@ - + @@ -194,7 +194,7 @@ - + @@ -209,14 +209,14 @@ @@ -224,7 +224,7 @@ Demo Opportunities --> - + opportunity @@ -239,7 +239,7 @@ - + opportunity @@ -261,7 +261,7 @@ - + opportunity @@ -288,7 +288,7 @@ Kitchen design crm.lead - + html email @@ -298,7 +298,7 @@ Reply crm.lead - + html comment @@ -307,7 +307,7 @@ Reply crm.lead - + html @@ -317,7 +317,7 @@ Reply crm.lead - + html @@ -327,7 +327,7 @@ Your inquiry crm.lead - + html email @@ -335,7 +335,7 @@ - + opportunity @@ -358,7 +358,7 @@ - + opportunity @@ -380,7 +380,7 @@ - + opportunity @@ -397,7 +397,7 @@ - + opportunity @@ -420,7 +420,7 @@ L25 4RL - + opportunity @@ -433,7 +433,7 @@ - + opportunity @@ -446,7 +446,7 @@ - + opportunity @@ -468,7 +468,7 @@ - + opportunity @@ -489,7 +489,7 @@ - + opportunity @@ -511,7 +511,7 @@ - + opportunity @@ -522,7 +522,7 @@ - + opportunity @@ -536,8 +536,8 @@ diff --git a/addons/crm/test/process/cancel_lead.yml b/addons/crm/test/process/cancel_lead.yml index 34dd8310022..86aba99c0e0 100644 --- a/addons/crm/test/process/cancel_lead.yml +++ b/addons/crm/test/process/cancel_lead.yml @@ -2,12 +2,12 @@ I cancel unqualified lead. - !python {model: crm.lead}: | - self.case_cancel(cr, uid, [ref("crm_case_itisatelesalescampaign0")]) + self.case_cancel(cr, uid, [ref("crm_case_1")]) - I check cancelled lead. - !python {model: crm.lead}: | - lead = self.browse(cr, uid, ref('crm_case_itisatelesalescampaign0')) + lead = self.browse(cr, uid, ref('crm_case_1')) assert lead.stage_id.id == ref('crm.stage_lead7'), "Stage should be 'Dead' and is %s." % (lead.stage_id.name) assert lead.state == 'cancel', "Opportunity is not in 'cancel' state." assert lead.probability == 0.0, 'Opportunity probability is wrong and should be 0.0.' @@ -15,31 +15,31 @@ I reset cancelled lead into unqualified lead. - !python {model: crm.lead}: | - self.case_reset(cr, uid, [ref("crm_case_itisatelesalescampaign0")]) + self.case_reset(cr, uid, [ref("crm_case_1")]) - I check unqualified lead after reset. - - !assert {model: crm.lead, id: crm.crm_case_itisatelesalescampaign0, string: Lead is in draft state}: + !assert {model: crm.lead, id: crm.crm_case_1, string: Lead is in draft state}: - state == "draft" - I re-open the lead - !python {model: crm.lead}: | - self.case_open(cr, uid, [ref("crm_case_itisatelesalescampaign0")]) + self.case_open(cr, uid, [ref("crm_case_1")]) - I check stage and state of the re-opened lead - !python {model: crm.lead}: | - lead = self.browse(cr, uid, ref('crm.crm_case_itisatelesalescampaign0')) + lead = self.browse(cr, uid, ref('crm.crm_case_1')) assert lead.stage_id.id == ref('crm.stage_lead2'), "Opportunity stage should be 'Qualification'." assert lead.state == 'open', "Opportunity should be in 'open' state." - I escalate the lead to parent team. - !python {model: crm.lead}: | - self.case_escalate(cr, uid, [ref("crm_case_itisatelesalescampaign0")]) + self.case_escalate(cr, uid, [ref("crm_case_1")]) - I check the lead is correctly escalated to the parent team. - - !assert {model: crm.lead, id: crm.crm_case_itisatelesalescampaign0, string: Escalate lead to parent team}: + !assert {model: crm.lead, id: crm.crm_case_1, string: Escalate lead to parent team}: - section_id.name == "Sales Department" diff --git a/addons/crm/test/process/lead2opportunity2win.yml b/addons/crm/test/process/lead2opportunity2win.yml index c9ee3916e24..5053ed3088b 100644 --- a/addons/crm/test/process/lead2opportunity2win.yml +++ b/addons/crm/test/process/lead2opportunity2win.yml @@ -4,30 +4,30 @@ I open customer lead. - !python {model: crm.lead}: | - self.case_open(cr, uid, [ref("crm_case_qrecorp0")]) + self.case_open(cr, uid, [ref("crm_case_4")]) - I check lead state is "Open". - - !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: Lead in open state}: + !assert {model: crm.lead, id: crm.crm_case_4, string: Lead in open state}: - state == "open" - I create partner from lead. - - !record {model: crm.lead2partner, id: crm_lead2partner_id1, context: '{"active_model": "crm.lead", "active_ids": [ref("crm_case_qrecorp0")]}'}: + !record {model: crm.lead2partner, id: crm_lead2partner_id1, context: '{"active_model": "crm.lead", "active_ids": [ref("crm_case_4")]}'}: - !python {model: crm.lead2partner}: | - context.update({'active_model': 'crm.lead', 'active_ids': [ref('crm_case_qrecorp0')], 'active_id': ref('crm_case_qrecorp0')}) + context.update({'active_model': 'crm.lead', 'active_ids': [ref('crm_case_4')], 'active_id': ref('crm_case_4')}) self.make_partner(cr, uid ,[ref("crm_lead2partner_id1")], context=context) - I convert lead into opportunity for exiting customer. - !python {model: crm.lead}: | - self.convert_opportunity(cr, uid ,[ref("crm_case_qrecorp0")], ref("base.res_partner_2")) + self.convert_opportunity(cr, uid ,[ref("crm_case_4")], ref("base.res_partner_2")) - I check details of converted opportunity. - !python {model: crm.lead}: | - lead = self.browse(cr, uid, ref('crm_case_qrecorp0')) + lead = self.browse(cr, uid, ref('crm_case_4')) assert lead.type == 'opportunity', 'Lead is not converted to opportunity!' assert lead.partner_id.id == ref("base.res_partner_2"), 'Partner missmatch!' assert lead.stage_id.id == ref("stage_lead1"), 'Stage of opportunity is incorrect!' @@ -36,7 +36,7 @@ - !python {model: crm.opportunity2phonecall}: | import time - context.update({'active_model': 'crm.lead', 'active_ids': [ref('crm_case_qrecorp0')]}) + context.update({'active_model': 'crm.lead', 'active_ids': [ref('crm_case_4')]}) call_id = self.create(cr, uid, {'date': time.strftime('%Y-%m-%d %H:%M:%S'), 'name': "Bonjour M. Jean, Comment êtes-vous? J'ai obtenu votre demande. peut-on parler au sujet de ce pour quelques minutes?"}, context=context) self.action_schedule(cr, uid, [call_id], context=context) @@ -44,28 +44,28 @@ I check that phonecall is scheduled for that opportunity. - !python {model: crm.phonecall}: | - ids = self.search(cr, uid, [('opportunity_id', '=', ref('crm_case_qrecorp0'))]) + ids = self.search(cr, uid, [('opportunity_id', '=', ref('crm_case_4'))]) assert len(ids), 'phonecall is not scheduled' - Now I schedule meeting with customer. - !python {model: crm.lead}: | - self.action_makeMeeting(cr, uid, [ref('crm_case_qrecorp0')]) + self.action_makeMeeting(cr, uid, [ref('crm_case_4')]) - After communicated with customer, I put some notes with contract details. - !python {model: crm.lead}: | - self.message_append_note(cr, uid, [ref('crm_case_qrecorp0')], subject='Test note', body='ces détails envoyés par le client sur ​​le FAX pour la qualité') + self.message_append_note(cr, uid, [ref('crm_case_4')], subject='Test note', body='ces détails envoyés par le client sur ​​le FAX pour la qualité') - I win this opportunity - !python {model: crm.lead}: | - self.case_mark_won(cr, uid, [ref("crm_case_qrecorp0")]) + self.case_mark_won(cr, uid, [ref("crm_case_4")]) - I check details of the opportunity after having won the opportunity. - !python {model: crm.lead}: | - lead = self.browse(cr, uid, ref('crm_case_qrecorp0')) + lead = self.browse(cr, uid, ref('crm_case_4')) assert lead.stage_id.id == ref('crm.stage_lead6'), "Opportunity stage should be 'Won'." assert lead.state == 'done', "Opportunity is not in 'done' state!" assert lead.probability == 100.0, "Revenue probability should be 100.0!" @@ -73,14 +73,14 @@ I convert mass lead into opportunity customer. - !python {model: crm.lead2opportunity.partner.mass}: | - context.update({'active_model': 'crm.lead', 'active_ids': [ref("crm_case_employee0"), ref("crm_case_electonicgoodsdealer0")], 'active_id': ref("crm_case_qrecorp0")}) + context.update({'active_model': 'crm.lead', 'active_ids': [ref("crm_case_11"), ref("crm_case_2")], 'active_id': ref("crm_case_4")}) id = self.create(cr, uid, {'user_ids': [ref('base.user_root')], 'section_id': ref('crm.section_sales_department')}, context=context) self.mass_convert(cr, uid, [id], context=context) - Now I check first lead converted on opportunity. - !python {model: crm.lead}: | - opp = self.browse(cr, uid, ref('crm_case_employee0')) + opp = self.browse(cr, uid, ref('crm_case_11')) assert opp.name == "Need Info about Onsite Intervention", "Opportunity name not correct" assert opp.type == 'opportunity', 'Lead is not converted to opportunity!' assert opp.partner_id.name == "Agrolait", 'Partner missmatch!' @@ -89,7 +89,7 @@ Then check for second lead converted on opportunity. - !python {model: crm.lead}: | - opp = self.browse(cr, uid, ref('crm_case_electonicgoodsdealer0')) + opp = self.browse(cr, uid, ref('crm_case_2')) assert opp.name == "Interest in Your New Product", "Opportunity name not correct" assert opp.type == 'opportunity', 'Lead is not converted to opportunity!' assert opp.stage_id.id == ref("stage_lead1"), 'Stage of probability is incorrect!' @@ -97,12 +97,12 @@ I loose the second opportunity - !python {model: crm.lead}: | - self.case_mark_lost(cr, uid, [ref("crm_case_electonicgoodsdealer0")]) + self.case_mark_lost(cr, uid, [ref("crm_case_2")]) - I check details of the opportunity after the loose - !python {model: crm.lead}: | - lead = self.browse(cr, uid, ref('crm_case_electonicgoodsdealer0')) + lead = self.browse(cr, uid, ref('crm_case_2')) assert lead.stage_id.id == ref('crm.stage_lead8'), "Opportunity stage should be 'Lost'." assert lead.state == 'cancel', "Lost opportunity is not in 'cancel' state!" assert lead.probability == 0.0, "Revenue probability should be 0.0!" diff --git a/addons/crm/test/ui/crm_demo.yml b/addons/crm/test/ui/crm_demo.yml index 3e53c722b5e..165d2694fd2 100644 --- a/addons/crm/test/ui/crm_demo.yml +++ b/addons/crm/test/ui/crm_demo.yml @@ -1,7 +1,7 @@ - I create lead record to call of partner onchange, stage onchange and Mailing opt-in onchange method. - - !record {model: crm.lead, id: crm_case_shelvehouse}: + !record {model: crm.lead, id: crm_case_25}: name: 'Need more info about your pc2' partner_id: base.res_partner_2 type: opportunity @@ -10,7 +10,7 @@ - I create lead record to call Mailing opt-out onchange method. - - !record {model: crm.lead, id: crm_case_mediapoleunits0}: + !record {model: crm.lead, id: crm_case_18}: name: 'Need 20 Days of Consultancy' type: opportunity state: draft @@ -25,4 +25,4 @@ I setting next stage "New" for the lead. - !python {model: crm.lead}: | - self.stage_next(cr, uid, [ref("crm_case_qrecorp0")], context={'stage_type': 'lead'}) + self.stage_next(cr, uid, [ref("crm_case_4")], context={'stage_type': 'lead'}) diff --git a/addons/crm/test/ui/delete_lead.yml b/addons/crm/test/ui/delete_lead.yml index 472b22d0d2d..49713039f22 100644 --- a/addons/crm/test/ui/delete_lead.yml +++ b/addons/crm/test/ui/delete_lead.yml @@ -2,4 +2,4 @@ I Unlink the Lead. - !python {model: crm.lead}: | - self.unlink(cr, uid, [ref("crm_case_qrecorp0")]) + self.unlink(cr, uid, [ref("crm_case_4")]) diff --git a/addons/crm/test/ui/duplicate_lead.yml b/addons/crm/test/ui/duplicate_lead.yml index 6b349ca350c..b6071ae9f9d 100644 --- a/addons/crm/test/ui/duplicate_lead.yml +++ b/addons/crm/test/ui/duplicate_lead.yml @@ -2,4 +2,4 @@ I make duplicate the Lead. - !python {model: crm.lead}: | - self.copy(cr, uid, ref("crm_case_qrecorp0")) + self.copy(cr, uid, ref("crm_case_4")) diff --git a/addons/crm_partner_assign/test/partner_assign.yml b/addons/crm_partner_assign/test/partner_assign.yml index 3ae36f8c225..bc4cd0d6e57 100644 --- a/addons/crm_partner_assign/test/partner_assign.yml +++ b/addons/crm_partner_assign/test/partner_assign.yml @@ -16,12 +16,12 @@ I assign nearest partner to opportunity. - !python {model: crm.lead}: | - self.assign_partner(cr, uid, [ref('crm.crm_case_abcfuelcounits0')], context=context) + self.assign_partner(cr, uid, [ref('crm.crm_case_19')], context=context) - I check assigned partner of opportunity who is nearest Geo Latitude and Longitude of opportunity. - !python {model: crm.lead}: | - lead = self.browse(cr, uid, ref('crm.crm_case_abcfuelcounits0')) + lead = self.browse(cr, uid, ref('crm.crm_case_19')) assert lead.partner_assigned_id.id == ref('base.res_partner_15') , "Opportuniy is not assigned nearest partner" assert 50 < lead.partner_latitude < 55 , "Latitude is wrong" assert -5 < lead.partner_longitude < 0, "Longitude is wrong" @@ -29,7 +29,7 @@ I forward this opportunity to its nearest partner. - !python {model: crm.lead.forward.to.partner}: | - context.update({'active_model': 'crm.lead', 'active_id': ref('crm.crm_case_abcfuelcounits0'), 'active_ids': [ref('crm.crm_case_abcfuelcounits0')]}) + context.update({'active_model': 'crm.lead', 'active_id': ref('crm.crm_case_19'), 'active_ids': [ref('crm.crm_case_19')]}) forward_id = self.create(cr, uid, {'email_from': 'test@openerp.com', 'send_to': 'partner'}, context=context) try: self.action_forward(cr, uid, [forward_id], context=context) diff --git a/addons/crm_todo/crm_todo_demo.xml b/addons/crm_todo/crm_todo_demo.xml index eef41bdc472..cec45141efb 100644 --- a/addons/crm_todo/crm_todo_demo.xml +++ b/addons/crm_todo/crm_todo_demo.xml @@ -3,13 +3,13 @@ - + - + - + diff --git a/addons/sale_crm/test/sale_crm.yml b/addons/sale_crm/test/sale_crm.yml index 8c62b19346b..011fb6ad5a8 100644 --- a/addons/sale_crm/test/sale_crm.yml +++ b/addons/sale_crm/test/sale_crm.yml @@ -19,12 +19,12 @@ - !python {model: crm.make.sale}: | crm_lead = self.pool.get('crm.lead') - crm = crm_lead.browse(cr, uid, ref("crm.crm_case_construstazunits0")) + crm = crm_lead.browse(cr, uid, ref("crm.crm_case_13")) self.makeOrder(cr, uid, [ref("crm_make_sale_0")], {"active_ids": [crm.id], "active_id": crm.id}) - I check that reference number of "Quotation" in opportunity. - !python {model: crm.lead}: | - crm = self.browse(cr, uid, ref("crm.crm_case_construstazunits0")) + crm = self.browse(cr, uid, ref("crm.crm_case_13")) assert crm.ref, "Quotation has not been created."