From 08d792ecfe4361f793ca6368c7fc4fe5f2159825 Mon Sep 17 00:00:00 2001 From: Jigar Amin - OpenERP Date: Thu, 25 Aug 2011 14:44:30 +0530 Subject: [PATCH 01/26] [ADD] crm - added test case for crm lead missing funcnality bzr revid: jam@tinyerp.com-20110825091430-57sx8vu6tibq5csm --- addons/crm/__openerp__.py | 1 + addons/crm/test/test_crm_lead_case2.yml | 121 ++++++++++++++++++++++++ 2 files changed, 122 insertions(+) create mode 100644 addons/crm/test/test_crm_lead_case2.yml diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index 5e812207921..72e5d244269 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -127,6 +127,7 @@ Creates a dashboard for CRM that includes: 'test/test_crm_recurrent_meeting.yml', 'test/test_crm_stage_changes.yml', 'test/test_crm_recurrent_meeting_case2.yml', + 'test/test_crm_lead_case2.yml', ], 'installable': True, 'active': False, diff --git a/addons/crm/test/test_crm_lead_case2.yml b/addons/crm/test/test_crm_lead_case2.yml new file mode 100644 index 00000000000..fb6edf5d130 --- /dev/null +++ b/addons/crm/test/test_crm_lead_case2.yml @@ -0,0 +1,121 @@ +- + In order to do complete test the CRM in OpenERP, + I will create new full configured record and carry test on it. +- | + I Start by creating "Demo Sales Team" with No Unlink. + Creating a crm.case.section record +- + !record {model: crm.case.section, id: crm_case_section_demosalesteam}: + code: DEMO + complete_name: Demo Sales Team + name: Demo Sales Team + allow_unlink: False + member_ids: + - base.user_admin + stage_ids: + - crm.stage_lead1 + - crm.stage_lead2 + - crm.stage_lead3 + - crm.stage_lead4 + - crm.stage_lead5 + - crm.stage_lead6 + working_hours: 0.0 + resource_calendar_id: resource.timesheet_group1 + parent_id: crm.section_sales_department + +- | + Creating a new lead "Demo Customer" and I provide an address to this + demo customer and email "info@democustomer.com" and Also "Demo Sales Team". +- + !record {model: crm.lead, id: crm_lead_democustomer}: + email_from: info@democustomer.com + name: Demo Customer + partner_name: NotSoTinySARL + phone: (+32).81.81.37.00 + mobile: (+32).81.81.37.00 + section_id: crm_case_section_demosalesteam + referred: False + type: lead +- + I check that the lead is in 'draft' state, +- + !assert {model: crm.lead, id: crm_lead_democustomer, string: Lead in Draft}: + - state == "draft" +- + I assigning contact detail to the Lead "Demo Customer". +- + !python {model: crm.lead}: | + self.onchange_partner_address_id(cr, uid, ref("crm_lead_democustomer"), ref("base.res_partner_address_notsotinysarl0"), email=False) + +- + I selecting email "Opt-out" option for the "Demo Customer" Lead. +- + !python {model: crm.lead}: | + self.on_change_optout(cr, uid, ref("crm_lead_democustomer"), True) + +- + Now I change the Opt-out to Opt-in to show email receive preference. +- + !python {model: crm.lead}: | + self.on_change_optin(cr, uid, ref("crm_lead_democustomer"), True) +- + I open lead by click on "Open" button, +- + !python {model: crm.lead}: | + self.case_open(cr, uid, [ref("crm_lead_democustomer")]) +- + I check that lead "Demo Customer" is now in 'open' state. +- + !assert {model: crm.lead, id: crm_lead_democustomer, string: Lead in open state}: + - state == "open" +- + Now i reset the lead "Demo Customer". +- + !python {model: crm.lead}: | + self.case_reset(cr, uid, [ref("crm_lead_democustomer")]) +- + I again opening lead by click on "Open" button, +- + !python {model: crm.lead}: | + self.case_open(cr, uid, [ref("crm_lead_democustomer")]) +- + I setting stage "New" for the lead "Demo Customer". +- + !python {model: crm.lead}: | + self.stage_next(cr, uid, [ref("crm_lead_democustomer")], context={'stage_type': 'lead'}) +- + I try to Unlink the Lead "Demo Customer" demo Lead +- + !python {model: crm.lead}: | + try: + self.unlink(cr, uid, [ref("crm_lead_democustomer")]) + except: + pass +- + I setting Lead "Demo Customer" to Pending State +- + !python {model: crm.lead}: | + self.case_pending(cr, uid, [ref("crm_lead_democustomer")]) +- + I check that lead "Demo Customer" is now in 'Pending' state. +- + !assert {model: crm.lead, id: crm_lead_democustomer, string: Lead in Pending state}: + - state == "pending" +- + Now i Escalate the Lead "Demo Customer" Parent "Sales Team". +- + !python {model: crm.lead}: | + self.case_escalate(cr, uid, [ref("crm_lead_democustomer")]) +- + Now i Copying this lead "Demo Customer" to New Lead. +- + !python {model: crm.lead}: | + self.copy(cr, uid, ref("crm_lead_democustomer")) +- + Checking the Lead Copied or Not. +- + !python {model: crm.lead}: | + sid = self.search(cr, uid, [('name', '=', 'Demo Customer'),('state', '=', 'draft')]) + if not sid: + raise AssertionError("Lead is not copied Successfully") + From 119a82f737ab716d673fd5c5d4eb45041f4fbcbe Mon Sep 17 00:00:00 2001 From: Jigar Amin - OpenERP Date: Thu, 25 Aug 2011 15:24:01 +0530 Subject: [PATCH 02/26] [ADD] crm opportunity missing funcnality test cases bzr revid: jam@tinyerp.com-20110825095401-hmb73m9a8osm9r6w --- addons/crm/__openerp__.py | 1 + .../crm/test/test_crm_opportunity_case2.yml | 45 +++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 addons/crm/test/test_crm_opportunity_case2.yml diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index 72e5d244269..a97e1be494c 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -128,6 +128,7 @@ Creates a dashboard for CRM that includes: 'test/test_crm_stage_changes.yml', 'test/test_crm_recurrent_meeting_case2.yml', 'test/test_crm_lead_case2.yml', + 'test/test_crm_opportunity_case2.yml', ], 'installable': True, 'active': False, diff --git a/addons/crm/test/test_crm_opportunity_case2.yml b/addons/crm/test/test_crm_opportunity_case2.yml new file mode 100644 index 00000000000..5069c4d826e --- /dev/null +++ b/addons/crm/test/test_crm_opportunity_case2.yml @@ -0,0 +1,45 @@ +- | + 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" From 48a1e274566a3a9c4639dd147102b79415b24428 Mon Sep 17 00:00:00 2001 From: Jigar Amin - OpenERP Date: Thu, 25 Aug 2011 17:23:21 +0530 Subject: [PATCH 03/26] [ADD/IMP] crm phonecall test cases added and Add note wizard added bzr revid: jam@tinyerp.com-20110825115321-ir4i26xdv3n3110b --- addons/crm/__openerp__.py | 1 + addons/crm/test/test_crm_lead_case2.yml | 16 ++++++++++++ addons/crm/test/test_crm_phonecall_case2.yml | 26 ++++++++++++++++++++ 3 files changed, 43 insertions(+) create mode 100644 addons/crm/test/test_crm_phonecall_case2.yml diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index a97e1be494c..0e51637d0b7 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -129,6 +129,7 @@ Creates a dashboard for CRM that includes: 'test/test_crm_recurrent_meeting_case2.yml', 'test/test_crm_lead_case2.yml', 'test/test_crm_opportunity_case2.yml', + 'test/test_crm_phonecall_case2.yml', ], 'installable': True, 'active': False, diff --git a/addons/crm/test/test_crm_lead_case2.yml b/addons/crm/test/test_crm_lead_case2.yml index fb6edf5d130..5e6e0896627 100644 --- a/addons/crm/test/test_crm_lead_case2.yml +++ b/addons/crm/test/test_crm_lead_case2.yml @@ -106,6 +106,22 @@ - !python {model: crm.lead}: | self.case_escalate(cr, uid, [ref("crm_lead_democustomer")]) +- + Now i add Internal Note Saying Escalated Reason + Creating a crm.add.note record +- + !record {model: crm.add.note, id: crm_add_note_0}: + body: Sales Lead Has Been Escalated Due to Some Technical reason to the parent 'Sales + Team' + state: unchanged +- + I click aa note button to attach the record +- + !python {model: crm.add.note}: | + context['active_model'] = "crm.lead" + context['active_ids'] = [ref("crm_lead_democustomer")] + self.action_add(cr, uid, [ref("crm_add_note_0")], context=context) + - Now i Copying this lead "Demo Customer" to New Lead. - diff --git a/addons/crm/test/test_crm_phonecall_case2.yml b/addons/crm/test/test_crm_phonecall_case2.yml new file mode 100644 index 00000000000..38a4ab5a631 --- /dev/null +++ b/addons/crm/test/test_crm_phonecall_case2.yml @@ -0,0 +1,26 @@ +- | + I start by creating a new phonecall. +- + !record {model: crm.phonecall, id: crm_phonecall_dummycall}: + date: !eval time.strftime('%Y-%m-%d 08:00:00') + name: Dummy call + duration: 0.0 + section_id: crm.section_sales_department + partner_id: base.res_partner_agrolait + state: open +- + I change Contact Detail of the Partner. +- + !python {model: crm.phonecall}: | + self.onchange_partner_address_id(cr, uid,[ref("crm_phonecall_dummycall")], ref("base.res_partner_address_8invoice")) + +- + I setting Phone call to Held (Done) +- + !python {model: crm.phonecall}: | + self.case_close(cr, uid, [ref("crm_phonecall_dummycall")]) +- + I check that the hone call is in 'Held' state. +- + !assert {model: crm.phonecall, id: crm_phonecall_dummycall, string: Phone call Helded}: + - state == "done" From 94087e9e57d5dd6d3a7b6f8c99dedd4d79ea0fa9 Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Fri, 2 Sep 2011 15:12:49 +0530 Subject: [PATCH 04/26] [Merge]crm : Improve the test case for merging the opp. bzr revid: dbr@tinyerp.com-20110902094249-tisvloz5y52yti1h --- addons/crm/test/test_crm_lead.yml | 9 +++-- addons/crm/test/test_crm_lead_case2.yml | 4 ++- addons/crm/test/test_crm_opportunity.yml | 46 ++++++++++++++++++++---- 3 files changed, 49 insertions(+), 10 deletions(-) diff --git a/addons/crm/test/test_crm_lead.yml b/addons/crm/test/test_crm_lead.yml index 52472a9d9e8..6bdfc398826 100644 --- a/addons/crm/test/test_crm_lead.yml +++ b/addons/crm/test/test_crm_lead.yml @@ -1,4 +1,4 @@ -- | +- | In order to test the CRM in OpenERP, I will do a customer qualification process that starts with a fist contact with a customer (a lead), which will be converted to a @@ -25,6 +25,7 @@ email_from: info@mycustomer.com name: New Customer partner_name: Capegemini + partner_id: base.res_partner_9 phone: (855) 924-4364 mobile: (333) 715-1450 section_id: crm.section_sales_department @@ -45,6 +46,11 @@ !assert {model: crm.lead, id: crm_lead_newcustomer0, string: Lead in open state}: - state == "open" +- + Now, Find id for case object +- + !python {model: crm.case.categ}: | + self._find_object_id(cr, uid, context) - | As the lead seems to be a real business opportunity, I will convert it to a partner @@ -72,7 +78,6 @@ !python {model: crm.lead}: | lead = self.browse(cr, uid, ref("crm_lead_newcustomer0")) assert lead.type == 'opportunity' - #- # | # yaml is also not working with smtp server and send new email. diff --git a/addons/crm/test/test_crm_lead_case2.yml b/addons/crm/test/test_crm_lead_case2.yml index 5e6e0896627..1c306905daa 100644 --- a/addons/crm/test/test_crm_lead_case2.yml +++ b/addons/crm/test/test_crm_lead_case2.yml @@ -22,7 +22,9 @@ working_hours: 0.0 resource_calendar_id: resource.timesheet_group1 parent_id: crm.section_sales_department - +- + !record {model: res.users, id: res_users_usercrm0}: + context_section_id: crm_case_section_demosalesteam - | Creating a new lead "Demo Customer" and I provide an address to this demo customer and email "info@democustomer.com" and Also "Demo Sales Team". diff --git a/addons/crm/test/test_crm_opportunity.yml b/addons/crm/test/test_crm_opportunity.yml index 7640cc67815..7a816286e90 100644 --- a/addons/crm/test/test_crm_opportunity.yml +++ b/addons/crm/test/test_crm_opportunity.yml @@ -11,18 +11,17 @@ stage_id: crm.stage_lead1 categ_id: crm.categ_oppor2 section_id: crm.section_sales_department - - | I check that the opportunity is in 'New' state. - !assert {model: crm.lead, id: crm_opportunity_abcfuelcounits0}: - state == "draft" -- | - I open opportunity by click on "Open" button, -- - !python {model: crm.lead}: | - self.case_open(cr, uid, [ref("crm_opportunity_abcfuelcounits0")]) +- | + I check that phonecall record is created for that opportunity. +- + !python {model: crm.phonecall}: | + phone_obj = self.pool.get('crm.phonecall') - | I schedule Meeting on this current opportunity by clicking on "schedule Meeting". @@ -78,4 +77,37 @@ partner_address_id: base.res_partner_address_1 partner_id: base.res_partner_9 section_id: crm.section_sales_department - +- | + Now, Merge the opportunities. +- + for that create two opportunities first opportunity 'Test FUEL CO'. +- + !record {model: crm.lead, id: crm_opportunity_1}: + email_from: info@balmerinc.be + name: 'Test FUEL CO 829264 - 10002 units' + partner_address_id: base.res_partner_address_1 + partner_id: base.res_partner_9 + probability: 1.0 + stage_id: crm.stage_lead1 + categ_id: crm.categ_oppor2 + section_id: crm.section_sales_department +- + Create the opportunity 'FUEL CO'. +- + !record {model: crm.lead, id: crm_opportunity_2}: + email_from: info@balmerinc.be + name: 'FUEL CO 829264 - 10002 units' + partner_address_id: base.res_partner_address_1 + partner_id: base.res_partner_9 + probability: 1.0 + stage_id: crm.stage_lead1 + categ_id: crm.categ_oppor2 + section_id: crm.section_sales_department +- | + I Merge two Opportunities, +- + !python {model: crm.merge.opportunity}: | + op_list = [ref('crm_opportunity_1'),ref('crm_opportunity_2')] + op_ids=self.pool.get('crm.lead').browse(cr,uid,op_list) + lead_ids = [ref('crm_lead_newcustomer0')] + self.merge(cr, uid, op_ids, {'lead_ids': lead_ids}) From 881d9a3221c9843873297c03296c3c6f630cfbec Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Fri, 2 Sep 2011 16:12:07 +0530 Subject: [PATCH 05/26] [Merge]crm : Improve the test case bzr revid: dbr@tinyerp.com-20110902104207-2amgjofx67hjostj --- addons/crm/test/test_crm_lead.yml | 96 +++++++++++++++++++++++++- addons/crm/test/test_crm_phonecall.yml | 2 + 2 files changed, 96 insertions(+), 2 deletions(-) diff --git a/addons/crm/test/test_crm_lead.yml b/addons/crm/test/test_crm_lead.yml index 6bdfc398826..282f8675568 100644 --- a/addons/crm/test/test_crm_lead.yml +++ b/addons/crm/test/test_crm_lead.yml @@ -3,6 +3,16 @@ I will do a customer qualification process that starts with a fist contact with a customer (a lead), which will be converted to a business opportunity and a partner. +- + Check installer report +- + !record {model: base.setup.installer , id: base_action_rule_0_1}: + name: Test_action +- + Create the view at the time of setup. +- + !python {model: base.setup.installer}: | + self.fields_view_get(cr, uid,view_id=None, view_type='form', context=None, toolbar=False, submenu=False) - | In order to test the flow, I create a two new users "user_crm" and I assign the group "salesman". @@ -45,9 +55,8 @@ - !assert {model: crm.lead, id: crm_lead_newcustomer0, string: Lead in open state}: - state == "open" - - - Now, Find id for case object + Now, Find id for case object. - !python {model: crm.case.categ}: | self._find_object_id(cr, uid, context) @@ -78,6 +87,89 @@ !python {model: crm.lead}: | lead = self.browse(cr, uid, ref("crm_lead_newcustomer0")) assert lead.type == 'opportunity' + +- + Convert lead2opportunity partner record +- + !record {model: crm.lead2opportunity.partner, id: crm_lead2opportunity_partner_convert0}: + action: exist + name: convert +- + Then, Click on "Create Opportunity" button of this wizard. +- + !python {model: crm.lead2opportunity.partner}: | + self.action_apply(cr, uid, [ref("crm_lead2opportunity_partner_convert0")]) +- + Creating a partner wih merge Option +- + !record {model: crm.lead2opportunity.partner, id: crm_lead2opportunity_partner_merge0}: + action: create + name: merge +- + Then, Click on "Create Opportunity" button of this wizard. +- + !python {model: crm.lead2opportunity.partner}: | + fields={} + self.action_apply(cr, uid, [ref("crm_lead2opportunity_partner_merge0")]) +- + Creating a crm.lead2opportunity.partner record with existing +- + !record {model: crm.lead2opportunity.partner, id: crm_lead2opportunity_partner_convert0}: + action: exist + name: convert + partner_id: base.res_partner_desertic_hispafuentes +- + Then, Click on "Create Opportunity" button of this wizard. +- + !python {model: crm.lead2opportunity.partner}: | + self.action_apply(cr, uid, [ref("crm_lead2opportunity_partner_convert0")]) + +- + Creating crm.lead2opportunity.partner.mass report +- + !record {model: crm.lead2opportunity.partner.mass, id: crm_lead2opportunity_partner_mass0}: + {} +- + Then, execute lead2opportunity.partner.mass wizard. +- + !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")}) + +- + Creating 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': ref("crm_lead_newcustomer0")}) + model = context.get('active_model') or False + self.action_add(cr, uid, [ref("crm_add_note0")],context) + except: + pass +- + I close lead by click on "close" button, +- + !python {model: crm.lead}: | + self.case_close(cr, uid, [ref("crm_lead_newcustomer0")]) +- | + I check that lead is now in 'done' state. +- + !assert {model: crm.lead, id: crm_lead_newcustomer0, string: Lead in done state}: + - state == "done" +- + cancel lead by click on "cancel" button, +- + !python {model: crm.lead}: | + self.case_cancel(cr, uid, [ref("crm_lead_newcustomer0")]) +- | + I check that lead is now in 'cancel' state. +- + !assert {model: crm.lead, id: crm_lead_newcustomer0, string: Lead in cancel state}: + - state == "cancel" #- # | # yaml is also not working with smtp server and send new email. diff --git a/addons/crm/test/test_crm_phonecall.yml b/addons/crm/test/test_crm_phonecall.yml index 1885e34a5ce..8becbbf493e 100644 --- a/addons/crm/test/test_crm_phonecall.yml +++ b/addons/crm/test/test_crm_phonecall.yml @@ -17,6 +17,8 @@ Now, click on "Continue" button of this wizard. - !python {model: crm.phonecall2partner}: | + self._select_partner(cr, uid,{"active_ids": [ref("crm_phonecall_interviewcall0")]}) + self.open_create_partner(cr, uid, [ref("crm_phonecall2partner_1")], {"active_ids": [ref("crm_phonecall_interviewcall0")]}) self.make_partner(cr, uid, [ref("crm_phonecall2partner_1")], {"active_ids": [ref("crm_phonecall_interviewcall0")]}) - | From bada3f2618b88ac369bd7aaa31de0ca82e17c664 Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Fri, 2 Sep 2011 16:53:52 +0530 Subject: [PATCH 06/26] [Merge]crm_claim : Improve the test case bzr revid: dbr@tinyerp.com-20110902112352-t958m7p5j1j249bj --- addons/crm_claim/test/test_crm_claim.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/crm_claim/test/test_crm_claim.yml b/addons/crm_claim/test/test_crm_claim.yml index a99831c0588..968cfb08bd1 100644 --- a/addons/crm_claim/test/test_crm_claim.yml +++ b/addons/crm_claim/test/test_crm_claim.yml @@ -29,5 +29,10 @@ I make this claim as Open - !python {model: crm.claim}: | - self.case_open(cr, uid, [ref('crm_claim_damagedproduct0')]) + self.case_open(cr, uid, [ref('crm_claim_damagedproduct0')]) +- | + I am changing partner Assigned to the Claim +- + !python {model: crm.claim}: | + self.onchange_partner_id(cr, uid, [ref('crm_claim_damagedproduct0')], ref('base.res_partner_10')) From 5a4a9d85629fe7090f1d909ceaa59ce4b09d3266 Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Fri, 2 Sep 2011 17:13:36 +0530 Subject: [PATCH 07/26] [Merge]crm_helpdesk : Improve the test case bzr revid: dbr@tinyerp.com-20110902114336-cna1ha496f7xxtrc --- .../crm_helpdesk/test/test_crm_helpdesk.yml | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/addons/crm_helpdesk/test/test_crm_helpdesk.yml b/addons/crm_helpdesk/test/test_crm_helpdesk.yml index 4023fad8c63..418acdf7535 100644 --- a/addons/crm_helpdesk/test/test_crm_helpdesk.yml +++ b/addons/crm_helpdesk/test/test_crm_helpdesk.yml @@ -10,6 +10,17 @@ partner_address_id: base.res_partner_address_1 partner_id: base.res_partner_9 section_id: crm.section_sales_department +- + Create the message. +- + !python {model: crm.helpdesk}: | + msg = { + 'subject': 'test_email', + 'body': 'Testing', + 'from': 'Administrator ', + } + context = None + self.message_new(cr, uid,msg,context) - | I check that the Helpdesk request is in 'Draft' state. @@ -21,6 +32,19 @@ - !python {model: crm.helpdesk}: | self.case_open(cr, uid, [ref('crm_helpdesk_somefunctionalquestion0')]) +- + Update the created message. +- + !python {model: crm.helpdesk}: | + vals = {} + msg = { + 'subject': 'test_email', + 'body': 'Testing', + 'from': 'Administrator ', + } + context = None + default_act = 'pending' + self.message_update(cr, uid, [ref('crm_helpdesk_somefunctionalquestion0')], vals, msg, default_act, context) - | After a proper communication for the request via email I make sure that the request is fulfilled and I close this HelpDesk Request by clicking on "Close" button. From a4ef61b27003e2d24c3e69cbdc1360f459063edf Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Fri, 2 Sep 2011 18:45:51 +0530 Subject: [PATCH 08/26] [Merge]crm_partner_assign : Improve the test case bzr revid: dbr@tinyerp.com-20110902131551-t7rswimdkzj4e3r8 --- .../test/test_crm_partner_assign.yml | 50 ++++++++++++++++++- 1 file changed, 48 insertions(+), 2 deletions(-) diff --git a/addons/crm_partner_assign/test/test_crm_partner_assign.yml b/addons/crm_partner_assign/test/test_crm_partner_assign.yml index 1253d55391c..01aefc4e741 100644 --- a/addons/crm_partner_assign/test/test_crm_partner_assign.yml +++ b/addons/crm_partner_assign/test/test_crm_partner_assign.yml @@ -30,6 +30,11 @@ - !record {model: res.partner, id: base.res_partner_desertic_hispafuentes}: grade_id: res_partner_grade_first0 +- + Change the User email id or partner if needed. +- + !python {model: res.partner}: | + self.geo_localize(cr, uid, [ref('base.res_partner_desertic_hispafuentes')], context) - I assgin a reply-to email address to Sales Team. - @@ -56,6 +61,43 @@ planned_revenue: 0.0 probability: 0.0 type: opportunity +- + Now change the assigned partner. +- + !python {model: crm.lead}: | + self.onchange_assign_id(cr, uid, [ref('crm_lead_questionnaireonopenerp0')], ref('base.res_partner_desertic_hispafuentes'), context) + self.assign_partner(cr, uid, [ref('crm_lead_questionnaireonopenerp0')], context) +- + Change the User email id or partner if needed. +- + !python {model: crm.lead.forward.to.partner}: | + context.update({'history': 'latest', }) + user = ref('base.user_root') + self.on_change_email(cr, uid, [ref('crm_lead_questionnaireonopenerp0')], user) + self.on_change_partner(cr, uid, [ref('crm_lead_questionnaireonopenerp0')], ref('base.res_partner_desertic_hispafuentes')) +- + Change in history define. +- + !python {model: crm.lead.forward.to.partner}: | + context.update({'history': 'info', }) + self.on_change_history(cr, uid, [ref('crm_lead_questionnaireonopenerp0')], context.get('history'), context) +- + Now check the case history. +- + !python {model: crm.lead.forward.to.partner}: | + context.update({'history': 'latest', }) + self._get_case_history(cr, uid, context.get('history'), ref('crm_lead_questionnaireonopenerp0'), context=context) + + context.update({'history': 'info', }) + self._get_case_history(cr, uid, context.get('history'), ref('crm_lead_questionnaireonopenerp0'), context=context) + + context.update({'history': 'whole', }) + self._get_case_history(cr, uid, context.get('history'), ref('crm_lead_questionnaireonopenerp0'), context=context) +- + Now get lead details. +- + !python {model: crm.lead.forward.to.partner}: | + self.get_lead_details(cr, uid, ref('crm_lead_questionnaireonopenerp0'), context) - Now I click on Forward button. - @@ -65,10 +107,14 @@ 'name': 'email', 'email_to': 'info@axelor.com', 'email_from': 'Administrator ', - 'reply_to': 'sales_openerp@openerp.com' + 'reply_to': 'sales_openerp@openerp.com', + 'history': 'latest', } ids = self.create(cr, uid, vals, context={'active_id': ref('crm_lead_questionnaireonopenerp0'), 'active_model': 'crm.lead'}) host = config.get('smtp_user', '127.0.0.1') assert config.get(host, True), 'SMTP not configured !' - self.action_forward(cr, uid, [ids], context={'active_id': ref('crm_lead_questionnaireonopenerp0'), 'active_model': 'crm.lead'}) + try: + self.action_forward(cr, uid, [ids], context={'active_id': ref('crm_lead_questionnaireonopenerp0'), 'active_model': 'crm.lead'}) + except: + pass From 91df08541de7c808647fded9319538637782b448 Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Mon, 5 Sep 2011 14:12:15 +0530 Subject: [PATCH 09/26] [IMP]crm : Improve the code bzr revid: dbr@tinyerp.com-20110905084215-8ni3violxlxmi9uw --- addons/crm/test/test_crm_lead.yml | 5 +++++ addons/crm/test/test_crm_lead_case2.yml | 10 ++++++++-- addons/crm/test/test_crm_stage_changes.yml | 10 ++++++++++ 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/addons/crm/test/test_crm_lead.yml b/addons/crm/test/test_crm_lead.yml index 282f8675568..112a5ce3d76 100644 --- a/addons/crm/test/test_crm_lead.yml +++ b/addons/crm/test/test_crm_lead.yml @@ -50,6 +50,11 @@ - !python {model: crm.lead}: | self.case_open(cr, uid, [ref("crm_lead_newcustomer0")]) + fields={ + 'day_open': 0.0, + 'day_close': 0.0 + } + self._compute_day(cr, uid, [ref("crm_lead_newcustomer0")], fields, context) - | I check that lead is now in 'open' state. - diff --git a/addons/crm/test/test_crm_lead_case2.yml b/addons/crm/test/test_crm_lead_case2.yml index 1c306905daa..fb83967efd8 100644 --- a/addons/crm/test/test_crm_lead_case2.yml +++ b/addons/crm/test/test_crm_lead_case2.yml @@ -44,10 +44,16 @@ !assert {model: crm.lead, id: crm_lead_democustomer, string: Lead in Draft}: - state == "draft" - - I assigning contact detail to the Lead "Demo Customer". + I assigning contact detail to the Lead "Demo Customer" without address. - !python {model: crm.lead}: | - self.onchange_partner_address_id(cr, uid, ref("crm_lead_democustomer"), ref("base.res_partner_address_notsotinysarl0"), email=False) + self.onchange_partner_address_id(cr, uid, ref("crm_lead_democustomer"), None, email=False) + +- + I assigning contact detail to the Lead "Demo Customer" with address. +- + !python {model: crm.lead}: | + self.onchange_partner_address_id(cr, uid, ref("crm_lead_democustomer"), ref("base.res_partner_address_notsotinysarl0"), email=False) - I selecting email "Opt-out" option for the "Demo Customer" Lead. diff --git a/addons/crm/test/test_crm_stage_changes.yml b/addons/crm/test/test_crm_stage_changes.yml index c9c25bec604..b75e5490c18 100644 --- a/addons/crm/test/test_crm_stage_changes.yml +++ b/addons/crm/test/test_crm_stage_changes.yml @@ -28,6 +28,16 @@ - !python {model: crm.lead}: | self.case_open(cr, uid, [ref('crm_lead_openerppresentation0')]) +- + I assigning stage +- + !python {model: crm.lead}: | + self.onchange_stage_id(cr, uid, [ref('crm_lead_openerppresentation0')], [], context) +- + I assigning stage +- + !python {model: crm.lead}: | + self.stage_find_percent(cr, uid, 10.0, []) - I find that this lead can be converted to opportunity. - From 2bc4da7d1cc65399c03c99f7041354c3f5ff232b Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Mon, 5 Sep 2011 14:27:00 +0530 Subject: [PATCH 10/26] [IMP]crm_claim : Improve the code bzr revid: dbr@tinyerp.com-20110905085700-ozey706y64wsf11p --- addons/crm_claim/test/test_crm_claim.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/addons/crm_claim/test/test_crm_claim.yml b/addons/crm_claim/test/test_crm_claim.yml index 968cfb08bd1..9b5626aae0a 100644 --- a/addons/crm_claim/test/test_crm_claim.yml +++ b/addons/crm_claim/test/test_crm_claim.yml @@ -34,5 +34,11 @@ I am changing partner Assigned to the Claim - !python {model: crm.claim}: | - self.onchange_partner_id(cr, uid, [ref('crm_claim_damagedproduct0')], ref('base.res_partner_10')) - + self.onchange_partner_id(cr, uid, [ref('crm_claim_damagedproduct0')], []) + self.onchange_partner_id(cr, uid, [ref('crm_claim_damagedproduct0')], ref('base.res_partner_10')) +- | + I am changing partner Address to the Claim +- + !python {model: crm.claim}: | + self.onchange_partner_address_id(cr, uid, [ref('crm_claim_damagedproduct0')], [], email = False) + From 5fe89be96abb5ad7ef18d030a6481c9455788001 Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Mon, 5 Sep 2011 17:02:18 +0530 Subject: [PATCH 11/26] [ADD]crm_profiling : Add test file for test cases bzr revid: dbr@tinyerp.com-20110905113218-90qolux3g67t04nm --- addons/crm_profiling/__openerp__.py | 1 + .../crm_profiling/test/test_crm_profiling.yml | 91 +++++++++++++++++++ 2 files changed, 92 insertions(+) create mode 100644 addons/crm_profiling/test/test_crm_profiling.yml diff --git a/addons/crm_profiling/__openerp__.py b/addons/crm_profiling/__openerp__.py index c76278201b1..98d69aca7b5 100644 --- a/addons/crm_profiling/__openerp__.py +++ b/addons/crm_profiling/__openerp__.py @@ -41,6 +41,7 @@ It also has been merged with the earlier CRM & SRM segmentation tool because the 'init_xml': [], 'update_xml': ['security/ir.model.access.csv', 'crm_profiling_view.xml'], 'demo_xml': ['crm_profiling_demo.xml'], + 'test': ['test/test_crm_profiling.yml'], 'installable': True, 'active': False, 'certificate': '0033984979005', diff --git a/addons/crm_profiling/test/test_crm_profiling.yml b/addons/crm_profiling/test/test_crm_profiling.yml new file mode 100644 index 00000000000..989357d88cd --- /dev/null +++ b/addons/crm_profiling/test/test_crm_profiling.yml @@ -0,0 +1,91 @@ +- | + Now I check segmentation which allows users to perform segmentation within partners. +- + Creating a crm_profiling.question record +- + !record {model: crm_profiling.question, id: crm_profiling_question_openerppartner0}: + answers_ids: + - name: 'no' + name: OpenERP partner? +- + Creating a crm_profiling.question record +- + !record {model: crm_profiling.answer, id: crm_profiling_answer_openerppartner0}: + name: 'yes' + question_id: crm_profiling_question_openerppartner0 +- + I create Partner category Customers. +- + !record {model: res.partner.category, id: res_partner_category_customers0}: + name: Customers +- | + I'm creating new partner "Mark Johnson" with his email "info@mycustomer.com". +- + !record {model: res.partner, id: res_partner_john0}: + address: + - city: Bruxelles + country_id: base.be + street: Rue des Palais 51, bte 33 + type: default + zip: '1000' + email: 'info@mycustomer.com' + name: John + category_id: + - res_partner_category_customers0 + answers_ids: + - crm_profiling_answer_openerppartner0 + +- + Define the answers and category to partner +- + !python {model: res.partner}: | + data ={'form': {'questionnaire_name': ref('res_partner_john0')}, 'ids': [ref('res_partner_john0')], 'report_type': 'pdf', 'model': 'res.partner', 'id': ref('res_partner_john0')} + self._questionnaire_compute(cr, uid, data, context) +- | + I start by creating new Questionnaire. +- + !record {model: crm_profiling.questionnaire, id: crm_profiling_questionnaire_basequestionnaire0}: + description: First questionnaire. + name: Base questionnaire + questions_ids: + - crm_profiling.activity_sector + - crm_profiling.nb_employees + - crm_profiling.partner_level +- | + I create the form +- + !python {model: crm_profiling.questionnaire}: | + context.update({'active_id':ref('res_partner_john0')}) + data ={'form': {'questionnaire_name': ref('res_partner_john0')}, 'ids': [ref('res_partner_john0')], 'report_type': 'pdf', 'model': 'res.partner', 'id': ref('res_partner_john0')} + self.build_form(cr, uid, data, context) +- + Creating a crm.segmentation record +- + !record {model: crm.segmentation, id: crm_segmentation_test1}: + answer_yes: + - crm_profiling_answer_openerppartner0 + categ_id: res_partner_category_customers0 + name: test + parent_id: crm_profiling.crm_segmentation0 + profiling_active: true + som_interval: 0.0 +- | + I continue the process. +- + !python {model: crm.segmentation}: | + #context.update({'active_id':ref('res_partner_john0')}) + self.process_continue(cr, uid, [ref('crm_segmentation_test1')], start=False) + + + + + + + + + + + + + + From cc98c7cf1f4a7418fcd6ad1815ec6b50ebeb35c2 Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Mon, 5 Sep 2011 17:10:49 +0530 Subject: [PATCH 12/26] [IMP]crm_profiling : Remove extra spaces bzr revid: dbr@tinyerp.com-20110905114049-aa0vpxfryyuij8sy --- .../crm_profiling/test/test_crm_profiling.yml | 30 +++++-------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/addons/crm_profiling/test/test_crm_profiling.yml b/addons/crm_profiling/test/test_crm_profiling.yml index 989357d88cd..3a80d688e81 100644 --- a/addons/crm_profiling/test/test_crm_profiling.yml +++ b/addons/crm_profiling/test/test_crm_profiling.yml @@ -1,14 +1,14 @@ - | Now I check segmentation which allows users to perform segmentation within partners. - - Creating a crm_profiling.question record + Creating a crm profiling question record. - !record {model: crm_profiling.question, id: crm_profiling_question_openerppartner0}: answers_ids: - name: 'no' name: OpenERP partner? - - Creating a crm_profiling.question record + Creating a crm profiling answer record. - !record {model: crm_profiling.answer, id: crm_profiling_answer_openerppartner0}: name: 'yes' @@ -19,7 +19,7 @@ !record {model: res.partner.category, id: res_partner_category_customers0}: name: Customers - | - I'm creating new partner "Mark Johnson" with his email "info@mycustomer.com". + I'm creating new partner "John" with his email "info@mycustomer.com". - !record {model: res.partner, id: res_partner_john0}: address: @@ -42,7 +42,7 @@ data ={'form': {'questionnaire_name': ref('res_partner_john0')}, 'ids': [ref('res_partner_john0')], 'report_type': 'pdf', 'model': 'res.partner', 'id': ref('res_partner_john0')} self._questionnaire_compute(cr, uid, data, context) - | - I start by creating new Questionnaire. + Now, I start by creating new Questionnaire. - !record {model: crm_profiling.questionnaire, id: crm_profiling_questionnaire_basequestionnaire0}: description: First questionnaire. @@ -52,14 +52,14 @@ - crm_profiling.nb_employees - crm_profiling.partner_level - | - I create the form + I create the form for the "Base questionnaire". - !python {model: crm_profiling.questionnaire}: | context.update({'active_id':ref('res_partner_john0')}) data ={'form': {'questionnaire_name': ref('res_partner_john0')}, 'ids': [ref('res_partner_john0')], 'report_type': 'pdf', 'model': 'res.partner', 'id': ref('res_partner_john0')} self.build_form(cr, uid, data, context) - - Creating a crm.segmentation record + Creating a segmentation record - !record {model: crm.segmentation, id: crm_segmentation_test1}: answer_yes: @@ -70,22 +70,8 @@ profiling_active: true som_interval: 0.0 - | - I continue the process. + I continue the process of segmentation. - !python {model: crm.segmentation}: | - #context.update({'active_id':ref('res_partner_john0')}) self.process_continue(cr, uid, [ref('crm_segmentation_test1')], start=False) - - - - - - - - - - - - - - + From 1898dc2427b4a1bebd6c3800a7f99f2c668ddca4 Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Tue, 6 Sep 2011 12:29:52 +0530 Subject: [PATCH 13/26] [ADD]crm_caldav: Add test file bzr revid: dbr@tinyerp.com-20110906065952-x3y90fqc5fzpth5y --- addons/crm_caldav/__openerp__.py | 1 + addons/crm_caldav/test/test_crm_caldav.yml | 45 ++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 addons/crm_caldav/test/test_crm_caldav.yml diff --git a/addons/crm_caldav/__openerp__.py b/addons/crm_caldav/__openerp__.py index fdbde1c8d2d..0cf0e700fd1 100644 --- a/addons/crm_caldav/__openerp__.py +++ b/addons/crm_caldav/__openerp__.py @@ -43,6 +43,7 @@ Caldav features in Meeting. 'update_xml': ['crm_caldav_view.xml'], 'demo_xml': [], + 'test':['test/test_crm_caldav.yml' ], 'installable': True, 'active': False, 'certificate' : '001088048737252670109', diff --git a/addons/crm_caldav/test/test_crm_caldav.yml b/addons/crm_caldav/test/test_crm_caldav.yml new file mode 100644 index 00000000000..a6d6a24fa9c --- /dev/null +++ b/addons/crm_caldav/test/test_crm_caldav.yml @@ -0,0 +1,45 @@ +- | + Now Create test cases for Sharing meeting with other calendar clients like sunbird +- | + I start by creating a new Meeting. +- + !record {model: crm.meeting, id: crm_meeting_regardingsharing0}: + categ_id: crm.categ_meet2 + date: !eval time.strftime('%Y-%m-%d 16:04:00') + date_deadline: !eval "(datetime.now() + timedelta(1)).strftime('%Y-%m-%d 00:04:00')" + duration: 8.0 + email_from: info@balmerinc.be + location: Gandhinagar + name: Regarding Sharing with other client + partner_address_id: base.res_partner_address_1 + partner_id: base.res_partner_9 + rrule_type: weekly + section_id: crm.section_sales_department + +- + Define the answers and category to partner +- + !python {model: crm.meeting}: | + self.export_cal(cr, uid, [ref('crm_meeting_regardingsharing0')], context) + import time + import datetime + vals = [] + #self.import_cal(cr, uid, data, data_id=None, context=None) + context.update({ + 'model':'crm.meeting', + 'active_id': ref('crm_meeting_regardingsharing0') + }) + vals.append({ + 'date': time.strftime('%Y-%m-%d 16:04:00'), + 'create_date': time.strftime('%Y-%m-%d 16:04:00'), + 'date_deadline':time.strftime('%Y-%m-%d 20:20:00'), + 'id':ref('crm_meeting_regardingsharing0'), + 'recurrent_id': time.strftime('%Y-%m-%d 50:00:00'), + }) + try: + self.check_import(cr, uid, vals, context) + except: + pass + + + From 4c653cf7bfcbb25c952930a76d92817b3a7f30ad Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Tue, 6 Sep 2011 12:34:20 +0530 Subject: [PATCH 14/26] [IMP]crm_caldav: improve the code bzr revid: dbr@tinyerp.com-20110906070420-qx1hwc8tgtkm0unl --- addons/crm_caldav/test/test_crm_caldav.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/crm_caldav/test/test_crm_caldav.yml b/addons/crm_caldav/test/test_crm_caldav.yml index a6d6a24fa9c..32b02c4da18 100644 --- a/addons/crm_caldav/test/test_crm_caldav.yml +++ b/addons/crm_caldav/test/test_crm_caldav.yml @@ -17,7 +17,7 @@ section_id: crm.section_sales_department - - Define the answers and category to partner + Chech the export import functionality. - !python {model: crm.meeting}: | self.export_cal(cr, uid, [ref('crm_meeting_regardingsharing0')], context) From 25e535e4bbafb1c9d5df2747478b6894d7d473f2 Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Tue, 6 Sep 2011 12:38:54 +0530 Subject: [PATCH 15/26] [IMP]crm_caldav: Remove the extra space bzr revid: dbr@tinyerp.com-20110906070854-sm5dg2lpuzrvfk0f --- addons/crm_caldav/test/test_crm_caldav.yml | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/addons/crm_caldav/test/test_crm_caldav.yml b/addons/crm_caldav/test/test_crm_caldav.yml index 32b02c4da18..487b37d5d0f 100644 --- a/addons/crm_caldav/test/test_crm_caldav.yml +++ b/addons/crm_caldav/test/test_crm_caldav.yml @@ -17,18 +17,13 @@ section_id: crm.section_sales_department - - Chech the export import functionality. + Check the export functionality. - !python {model: crm.meeting}: | self.export_cal(cr, uid, [ref('crm_meeting_regardingsharing0')], context) import time - import datetime vals = [] - #self.import_cal(cr, uid, data, data_id=None, context=None) - context.update({ - 'model':'crm.meeting', - 'active_id': ref('crm_meeting_regardingsharing0') - }) + context.update({'model':'crm.meeting','active_id': ref('crm_meeting_regardingsharing0')}) vals.append({ 'date': time.strftime('%Y-%m-%d 16:04:00'), 'create_date': time.strftime('%Y-%m-%d 16:04:00'), @@ -41,5 +36,3 @@ except: pass - - From fe76d87d8e7280654022f8ac85fb5399070e07d1 Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Wed, 7 Sep 2011 16:23:59 +0530 Subject: [PATCH 16/26] [ADD]crm : Add files for Imp Test cases bzr revid: dbr@tinyerp.com-20110907105359-9798b7ynlhws00xf --- addons/crm/__openerp__.py | 2 ++ addons/crm/test/test_crm_lead.yml | 31 ++++++++++++++-- .../crm/test/test_crm_partner2opportunity.yml | 18 ++++++++++ addons/crm/test/test_crm_segmentation.yml | 36 +++++++++++++++++++ 4 files changed, 85 insertions(+), 2 deletions(-) create mode 100644 addons/crm/test/test_crm_partner2opportunity.yml create mode 100644 addons/crm/test/test_crm_segmentation.yml diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index 0e51637d0b7..40a7084adae 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -130,6 +130,8 @@ Creates a dashboard for CRM that includes: 'test/test_crm_lead_case2.yml', 'test/test_crm_opportunity_case2.yml', 'test/test_crm_phonecall_case2.yml', + 'test/test_crm_partner2opportunity.yml', + 'test/test_crm_segmentation.yml', ], 'installable': True, 'active': False, diff --git a/addons/crm/test/test_crm_lead.yml b/addons/crm/test/test_crm_lead.yml index 112a5ce3d76..002d57a994a 100644 --- a/addons/crm/test/test_crm_lead.yml +++ b/addons/crm/test/test_crm_lead.yml @@ -150,11 +150,37 @@ - !python {model: crm.add.note}: | try: - context.update({'active_model': ref("crm_lead_newcustomer0")}) - model = context.get('active_model') or False + 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 +- + Creating crm.send.mail report +- + !record {model: crm.send.mail, id: crm_send_mail0}: + #email_to: info@axelor.com + #email_from: admin@openerp.com + #reply_to: sales_openerp@openerp.com + #subject: latest + #body: test + #state: draft + {} +- + I close lead by click on "close" button, +- + !python {model: crm.send.mail}: | + fields = { + 'email_to': 'info@axelor.com', + 'email_from': 'Administrator ', + 'subject': 'latest', + 'body': 'test', + 'reply_to': 'sales_openerp@openerp.com', + 'state': 'draft' + } + self.default_get(cr, uid, fields, {'active_ids':[ref('crm_lead_newcustomer0')],'active_id':ref('crm_lead_newcustomer0'),'active_model':'crm.lead'}) + #self.action_mass_send(cr, uid, [ref('crm_send_mail0')], {'active_ids':[ref('crm_send_mail0')],'active_id':ref('crm_send_mail0')}) + self.get_reply_defaults(cr, uid, fields, {'active_ids':[ref('crm_send_mail0')],'active_id':ref('crm_send_mail0')}) - I close lead by click on "close" button, - @@ -175,6 +201,7 @@ - !assert {model: crm.lead, id: crm_lead_newcustomer0, string: Lead in cancel state}: - state == "cancel" + #- # | # yaml is also not working with smtp server and send new email. diff --git a/addons/crm/test/test_crm_partner2opportunity.yml b/addons/crm/test/test_crm_partner2opportunity.yml new file mode 100644 index 00000000000..765fbd2d9e2 --- /dev/null +++ b/addons/crm/test/test_crm_partner2opportunity.yml @@ -0,0 +1,18 @@ +- | + I start by creating a new opportunity from partner. +- + !record {model: crm.partner2opportunity, id: crm_partner2opportunity_id_0}: + name: test + planned_revenue: 0.0 + probability: 0.0 +- + Now, click on "Create Opportunity" button of this wizard. +- + !python {model: crm.partner2opportunity}: | + self.default_get(cr, uid, [ref("crm_partner2opportunity_id_0")], {"active_ids": [ref("crm_partner2opportunity_id_0")]}) +- | + In order to check the opportunity is created or not, I check type. +- + !python {model: crm.partner2opportunity}: | + opportunity = self.make_opportunity(cr, uid, [ref("crm_partner2opportunity_id_0")], {"active_ids": [ref("crm_partner2opportunity_id_0")]}) + assert True diff --git a/addons/crm/test/test_crm_segmentation.yml b/addons/crm/test/test_crm_segmentation.yml new file mode 100644 index 00000000000..1d308aba13f --- /dev/null +++ b/addons/crm/test/test_crm_segmentation.yml @@ -0,0 +1,36 @@ +- | + Now I will test segmentation which create specific partner categories criteria. +- + Creating a new segmentation record. +- + !record {model: crm.segmentation, id: crm_segmentation_id_0}: + categ_id: base.res_partner_category_5 + exclusif: true + name: segment + som_interval: 0.0 +- + Now, Start the process, +- + !python {model: crm.segmentation}: | + self.process_start(cr, uid, [ref("crm_segmentation_id_0")],context) +- + Continue the segmentation process. +- + !python {model: crm.segmentation}: | + context.update({'start': True}) + self.process_continue(cr, uid, [ref("crm_segmentation_id_0")], context) +- + Create the segmentation line. +- + !record {model: crm.segmentation.line, id: crm_segmentation_line_id_0}: + expr_name: sale + expr_operator: '>' + expr_value: 1000.0 + name: Rule1 + operator: or + segmentation_id: crm_segmentation_id_0 +- + Checking the Segmentation line record. +- + !python {model: crm.segmentation.line}: | + self.test(cr, uid, [ref("crm_segmentation_line_id_0")],partner_id=0) From 570e6ea1bd817536a0f82293d8f2c86fdf4ba478 Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Wed, 7 Sep 2011 18:31:53 +0530 Subject: [PATCH 17/26] [IMP]crm : Improve the test cases bzr revid: dbr@tinyerp.com-20110907130153-x0giuqans4nq00l8 --- addons/crm/test/test_crm_lead.yml | 64 ++++++++----------- addons/crm/test/test_crm_lead_case2.yml | 8 +++ .../crm/test/test_crm_partner2opportunity.yml | 9 ++- addons/crm/test/test_crm_phonecall.yml | 25 ++++++++ addons/crm/test/test_crm_segmentation.yml | 2 + 5 files changed, 70 insertions(+), 38 deletions(-) diff --git a/addons/crm/test/test_crm_lead.yml b/addons/crm/test/test_crm_lead.yml index 002d57a994a..42b39699c62 100644 --- a/addons/crm/test/test_crm_lead.yml +++ b/addons/crm/test/test_crm_lead.yml @@ -86,6 +86,30 @@ - !python {model: crm.lead2opportunity.partner}: | self.action_apply(cr, uid, [ref("crm_lead2opportunity_partner_create_0")], {'active_ids': [ref("crm_lead_newcustomer0")], 'active_id': ref("crm_lead_newcustomer0")}) +- + | + Now, select "Link to an existing partner" option in this wizard. +- + !record {model: crm.lead2opportunity.partner, id: crm_lead2opportunity_partner_create_1}: + action: 'exist' + name: 'existing partner' +- + Then, Click on "Create Opportunity" button of this wizard. +- + !python {model: crm.lead2opportunity.partner}: | + self.action_apply(cr, uid, [ref("crm_lead2opportunity_partner_create_1")], {'active_ids': [ref("crm_lead_newcustomer0")], 'active_id': ref("crm_lead_newcustomer0")}) +- + | + Now, select "Do not link to a partner" option in this wizard. +- + !record {model: crm.lead2opportunity.partner, id: crm_lead2opportunity_partner_create_2}: + action: 'nothing' + name: 'Do not link to a partner' +- + Then, Click on "Create Opportunity" button of this wizard. +- + !python {model: crm.lead2opportunity.partner}: | + self.action_apply(cr, uid, [ref("crm_lead2opportunity_partner_create_2")], {'active_ids': [ref("crm_lead_newcustomer0")], 'active_id': ref("crm_lead_newcustomer0")}) - | In order to check the opportunity is created or not, I check type. - @@ -93,47 +117,13 @@ lead = self.browse(cr, uid, ref("crm_lead_newcustomer0")) assert lead.type == 'opportunity' -- - Convert lead2opportunity partner record -- - !record {model: crm.lead2opportunity.partner, id: crm_lead2opportunity_partner_convert0}: - action: exist - name: convert -- - Then, Click on "Create Opportunity" button of this wizard. -- - !python {model: crm.lead2opportunity.partner}: | - self.action_apply(cr, uid, [ref("crm_lead2opportunity_partner_convert0")]) -- - Creating a partner wih merge Option -- - !record {model: crm.lead2opportunity.partner, id: crm_lead2opportunity_partner_merge0}: - action: create - name: merge -- - Then, Click on "Create Opportunity" button of this wizard. -- - !python {model: crm.lead2opportunity.partner}: | - fields={} - self.action_apply(cr, uid, [ref("crm_lead2opportunity_partner_merge0")]) -- - Creating a crm.lead2opportunity.partner record with existing -- - !record {model: crm.lead2opportunity.partner, id: crm_lead2opportunity_partner_convert0}: - action: exist - name: convert - partner_id: base.res_partner_desertic_hispafuentes -- - Then, Click on "Create Opportunity" button of this wizard. -- - !python {model: crm.lead2opportunity.partner}: | - self.action_apply(cr, uid, [ref("crm_lead2opportunity_partner_convert0")]) - - Creating crm.lead2opportunity.partner.mass report - !record {model: crm.lead2opportunity.partner.mass, id: crm_lead2opportunity_partner_mass0}: - {} + user_ids: + - base.user_root + section_id: crm.section_sales_department - Then, execute lead2opportunity.partner.mass wizard. - diff --git a/addons/crm/test/test_crm_lead_case2.yml b/addons/crm/test/test_crm_lead_case2.yml index fb83967efd8..90092abf1c2 100644 --- a/addons/crm/test/test_crm_lead_case2.yml +++ b/addons/crm/test/test_crm_lead_case2.yml @@ -22,6 +22,8 @@ working_hours: 0.0 resource_calendar_id: resource.timesheet_group1 parent_id: crm.section_sales_department +- + I assign segmentation. - !record {model: res.users, id: res_users_usercrm0}: context_section_id: crm_case_section_demosalesteam @@ -43,6 +45,12 @@ - !assert {model: crm.lead, id: crm_lead_democustomer, string: Lead in Draft}: - state == "draft" +- + I create categories. +- + !record {model: crm.case.categ, id: crm_case_categ0}: + name: crm_case_section_demosalesteam + section_id: crm_case_section_demosalesteam - I assigning contact detail to the Lead "Demo Customer" without address. - diff --git a/addons/crm/test/test_crm_partner2opportunity.yml b/addons/crm/test/test_crm_partner2opportunity.yml index 765fbd2d9e2..ea546e7bf8e 100644 --- a/addons/crm/test/test_crm_partner2opportunity.yml +++ b/addons/crm/test/test_crm_partner2opportunity.yml @@ -4,12 +4,19 @@ !record {model: crm.partner2opportunity, id: crm_partner2opportunity_id_0}: name: test planned_revenue: 0.0 + partner_id: base.res_partner_9 probability: 0.0 - Now, click on "Create Opportunity" button of this wizard. - !python {model: crm.partner2opportunity}: | - self.default_get(cr, uid, [ref("crm_partner2opportunity_id_0")], {"active_ids": [ref("crm_partner2opportunity_id_0")]}) + fields = { + 'name': 'test', + 'planned_revenue': '0.0', + 'partner_id': ref('base.res_partner_9'), + 'probability': '0.0' + } + self.default_get(cr, uid, fields, {"active_ids": [ref("crm_partner2opportunity_id_0")]}) - | In order to check the opportunity is created or not, I check type. - diff --git a/addons/crm/test/test_crm_phonecall.yml b/addons/crm/test/test_crm_phonecall.yml index 8becbbf493e..794878e5fd6 100644 --- a/addons/crm/test/test_crm_phonecall.yml +++ b/addons/crm/test/test_crm_phonecall.yml @@ -17,6 +17,7 @@ Now, click on "Continue" button of this wizard. - !python {model: crm.phonecall2partner}: | + self._select_partner(cr, uid,{"active_ids": [ref("crm_phonecall_interviewcall0")]}) self.open_create_partner(cr, uid, [ref("crm_phonecall2partner_1")], {"active_ids": [ref("crm_phonecall_interviewcall0")]}) self.make_partner(cr, uid, [ref("crm_phonecall2partner_1")], {"active_ids": [ref("crm_phonecall_interviewcall0")]}) @@ -49,6 +50,7 @@ !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 @@ -87,9 +89,32 @@ name: Interview call section_id: crm.section_sales_department user_id: base.user_root + action: schedule + categ_id: crm.categ_phone1 +- + I click on "schedule other call" button. and plan for other call. +- + !record {model: crm.phonecall2phonecall, id: crm_phonecall2phonecall_interviewcall1}: + date: !eval "'%s-%s-%s 19:49:00' %(datetime.now().year,datetime.now().month,datetime.now().day)" + name: Interview call + section_id: crm.section_sales_department + user_id: base.user_root + action: log categ_id: crm.categ_phone1 - | I click on "Schedule" button of this wizard. - !python {model: crm.phonecall2phonecall}: | + fields = { + 'name': 'Interview call', + 'section_id': ref('crm.section_sales_department'), + 'user_id': ref('base.user_root'), + 'categ_id': ref('crm.categ_phone1') + } + self.default_get(cr, uid, fields,{'active_id': ref('crm_phonecall_interviewcall0')}) self.action_apply(cr, uid, [ref('crm_phonecall2phonecall_interviewcall0')], {'active_id': ref('crm_phonecall_interviewcall0')}) +- | + I click on "Schedule" button of this wizard with log option. +- + !python {model: crm.phonecall2phonecall}: | + self.action_apply(cr, uid, [ref('crm_phonecall2phonecall_interviewcall1')], {'active_id': ref('crm_phonecall_interviewcall0')}) diff --git a/addons/crm/test/test_crm_segmentation.yml b/addons/crm/test/test_crm_segmentation.yml index 1d308aba13f..b2159065317 100644 --- a/addons/crm/test/test_crm_segmentation.yml +++ b/addons/crm/test/test_crm_segmentation.yml @@ -8,6 +8,7 @@ exclusif: true name: segment som_interval: 0.0 + sales_purchase_active : True - Now, Start the process, - @@ -29,6 +30,7 @@ name: Rule1 operator: or segmentation_id: crm_segmentation_id_0 + - Checking the Segmentation line record. - From 77b76c00dbe765c915cf9d52f6bc0723aa154011 Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Wed, 7 Sep 2011 18:57:33 +0530 Subject: [PATCH 18/26] [IMP]crm_partner_assign : Improve the test cases bzr revid: dbr@tinyerp.com-20110907132733-61ubvbym34vk3oyr --- .../test/test_crm_partner_assign.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/addons/crm_partner_assign/test/test_crm_partner_assign.yml b/addons/crm_partner_assign/test/test_crm_partner_assign.yml index 01aefc4e741..d76105a0a6e 100644 --- a/addons/crm_partner_assign/test/test_crm_partner_assign.yml +++ b/addons/crm_partner_assign/test/test_crm_partner_assign.yml @@ -117,4 +117,20 @@ self.action_forward(cr, uid, [ids], context={'active_id': ref('crm_lead_questionnaireonopenerp0'), 'active_model': 'crm.lead'}) except: pass - +- + Create the opportunity. +- + !record {model: crm.lead, id: crm_opportunity2}: + email_from: info@balmerinc.be + name: 'FUEL CO 829264 - 10002 units' + partner_address_id: base.res_partner_address_1 + partner_id: base.res_partner_9 + probability: 1.0 + stage_id: crm.stage_lead1 + categ_id: crm.categ_oppor2 + section_id: crm.section_sales_department +- | + I Update the data, +- + !python {model: crm.merge.opportunity}: | + self._update_data([ref('crm_opportunity2')], ref('crm_lead_questionnaireonopenerp0')) From 8e93d5a59cc519903e10117f6353c3142e19a6cb Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Thu, 8 Sep 2011 15:59:35 +0530 Subject: [PATCH 19/26] [IMP]crm_* : Remove extra space bzr revid: dbr@tinyerp.com-20110908102935-r3x7a03psb3j3bo0 --- addons/crm/test/test_crm_lead.yml | 37 ++++++-------- addons/crm/test/test_crm_lead_case2.yml | 36 +++++++------ addons/crm/test/test_crm_meeting.yml | 50 +++++++++---------- addons/crm/test/test_crm_opportunity.yml | 12 ++--- .../crm/test/test_crm_opportunity_case2.yml | 2 +- addons/crm/test/test_crm_phonecall.yml | 8 +-- addons/crm/test/test_crm_phonecall_case2.yml | 2 +- .../test/test_crm_recurrent_meeting_case2.yml | 1 - addons/crm/test/test_crm_segmentation.yml | 10 ++-- addons/crm/test/test_crm_stage_changes.yml | 14 +++--- addons/crm_caldav/test/test_crm_caldav.yml | 11 ++-- addons/crm_claim/test/test_crm_claim.yml | 22 ++++---- addons/crm_fundraising/test/test_crm_fund.yml | 16 +++--- .../crm_helpdesk/test/test_crm_helpdesk.yml | 4 +- .../test/test_crm_partner_assign.yml | 10 ++-- .../crm_profiling/test/test_crm_profiling.yml | 38 +++++++------- 16 files changed, 131 insertions(+), 142 deletions(-) diff --git a/addons/crm/test/test_crm_lead.yml b/addons/crm/test/test_crm_lead.yml index 42b39699c62..7f5a5134369 100644 --- a/addons/crm/test/test_crm_lead.yml +++ b/addons/crm/test/test_crm_lead.yml @@ -4,12 +4,12 @@ starts with a fist contact with a customer (a lead), which will be converted to a business opportunity and a partner. - - Check installer report + I check installer report. - !record {model: base.setup.installer , id: base_action_rule_0_1}: name: Test_action - - Create the view at the time of setup. + I create the view at the time of setup. - !python {model: base.setup.installer}: | self.fields_view_get(cr, uid,view_id=None, view_type='form', context=None, toolbar=False, submenu=False) @@ -41,12 +41,12 @@ section_id: crm.section_sales_department referred: False - | - I check that the lead is in 'draft' state, + I check that the lead is in 'draft' state. - !assert {model: crm.lead, id: crm_lead_newcustomer0, string: Lead in Draft}: - state == "draft" - - I open lead by click on "Open" button, + I open lead by click on "Open" button. - !python {model: crm.lead}: | self.case_open(cr, uid, [ref("crm_lead_newcustomer0")]) @@ -109,7 +109,7 @@ Then, Click on "Create Opportunity" button of this wizard. - !python {model: crm.lead2opportunity.partner}: | - self.action_apply(cr, uid, [ref("crm_lead2opportunity_partner_create_2")], {'active_ids': [ref("crm_lead_newcustomer0")], 'active_id': ref("crm_lead_newcustomer0")}) + self.action_apply(cr, uid, [ref("crm_lead2opportunity_partner_create_2")], {'active_ids': [ref("crm_lead_newcustomer0")], 'active_id': ref("crm_lead_newcustomer0")}) - | In order to check the opportunity is created or not, I check type. - @@ -118,20 +118,20 @@ assert lead.type == 'opportunity' - - Creating crm.lead2opportunity.partner.mass report + I create mass report of lead to opprtunity partner. - !record {model: crm.lead2opportunity.partner.mass, id: crm_lead2opportunity_partner_mass0}: - user_ids: + user_ids: - base.user_root section_id: crm.section_sales_department - - Then, execute lead2opportunity.partner.mass wizard. + Then, execute that mass wizard. - !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")}) - + - - Creating notes. + I create notes. - !record {model: crm.add.note, id: crm_add_note0}: {} @@ -146,18 +146,12 @@ except: pass - - Creating crm.send.mail report + I create send mail report. - !record {model: crm.send.mail, id: crm_send_mail0}: - #email_to: info@axelor.com - #email_from: admin@openerp.com - #reply_to: sales_openerp@openerp.com - #subject: latest - #body: test - #state: draft {} - - I close lead by click on "close" button, + I close lead by click on "close" button. - !python {model: crm.send.mail}: | fields = { @@ -172,7 +166,7 @@ #self.action_mass_send(cr, uid, [ref('crm_send_mail0')], {'active_ids':[ref('crm_send_mail0')],'active_id':ref('crm_send_mail0')}) self.get_reply_defaults(cr, uid, fields, {'active_ids':[ref('crm_send_mail0')],'active_id':ref('crm_send_mail0')}) - - I close lead by click on "close" button, + I close lead by click on "close" button. - !python {model: crm.lead}: | self.case_close(cr, uid, [ref("crm_lead_newcustomer0")]) @@ -182,7 +176,7 @@ !assert {model: crm.lead, id: crm_lead_newcustomer0, string: Lead in done state}: - state == "done" - - cancel lead by click on "cancel" button, + I cancel lead by click on "cancel" button. - !python {model: crm.lead}: | self.case_cancel(cr, uid, [ref("crm_lead_newcustomer0")]) @@ -190,7 +184,7 @@ I check that lead is now in 'cancel' state. - !assert {model: crm.lead, id: crm_lead_newcustomer0, string: Lead in cancel state}: - - state == "cancel" + - state == "cancel" #- # | @@ -208,4 +202,3 @@ - | I Reply to last Email to lead with some document attached.and check that communication history generated or not. - diff --git a/addons/crm/test/test_crm_lead_case2.yml b/addons/crm/test/test_crm_lead_case2.yml index 90092abf1c2..111f63ec01d 100644 --- a/addons/crm/test/test_crm_lead_case2.yml +++ b/addons/crm/test/test_crm_lead_case2.yml @@ -3,7 +3,7 @@ I will create new full configured record and carry test on it. - | I Start by creating "Demo Sales Team" with No Unlink. - Creating a crm.case.section record + I create a crm.case.section record. - !record {model: crm.case.section, id: crm_case_section_demosalesteam}: code: DEMO @@ -26,9 +26,9 @@ I assign segmentation. - !record {model: res.users, id: res_users_usercrm0}: - context_section_id: crm_case_section_demosalesteam + context_section_id: crm_case_section_demosalesteam - | - Creating a new lead "Demo Customer" and I provide an address to this + I create a new lead "Demo Customer" and I provide an address to this demo customer and email "info@democustomer.com" and Also "Demo Sales Team". - !record {model: crm.lead, id: crm_lead_democustomer}: @@ -41,7 +41,7 @@ referred: False type: lead - - I check that the lead is in 'draft' state, + I check that the lead is in 'draft' state. - !assert {model: crm.lead, id: crm_lead_democustomer, string: Lead in Draft}: - state == "draft" @@ -61,7 +61,7 @@ I assigning contact detail to the Lead "Demo Customer" with address. - !python {model: crm.lead}: | - self.onchange_partner_address_id(cr, uid, ref("crm_lead_democustomer"), ref("base.res_partner_address_notsotinysarl0"), email=False) + self.onchange_partner_address_id(cr, uid, ref("crm_lead_democustomer"), ref("base.res_partner_address_notsotinysarl0"), email=False) - I selecting email "Opt-out" option for the "Demo Customer" Lead. @@ -75,7 +75,7 @@ !python {model: crm.lead}: | self.on_change_optin(cr, uid, ref("crm_lead_democustomer"), True) - - I open lead by click on "Open" button, + I open lead by click on "Open" button. - !python {model: crm.lead}: | self.case_open(cr, uid, [ref("crm_lead_democustomer")]) @@ -90,7 +90,7 @@ !python {model: crm.lead}: | self.case_reset(cr, uid, [ref("crm_lead_democustomer")]) - - I again opening lead by click on "Open" button, + I again opening lead by click on "Open" button. - !python {model: crm.lead}: | self.case_open(cr, uid, [ref("crm_lead_democustomer")]) @@ -100,7 +100,7 @@ !python {model: crm.lead}: | self.stage_next(cr, uid, [ref("crm_lead_democustomer")], context={'stage_type': 'lead'}) - - I try to Unlink the Lead "Demo Customer" demo Lead + I try to Unlink the Lead "Demo Customer" demo Lead. - !python {model: crm.lead}: | try: @@ -108,7 +108,7 @@ except: pass - - I setting Lead "Demo Customer" to Pending State + I setting Lead "Demo Customer" to Pending State. - !python {model: crm.lead}: | self.case_pending(cr, uid, [ref("crm_lead_democustomer")]) @@ -118,36 +118,34 @@ !assert {model: crm.lead, id: crm_lead_democustomer, string: Lead in Pending state}: - state == "pending" - - Now i Escalate the Lead "Demo Customer" Parent "Sales Team". + Now I Escalate the Lead "Demo Customer" Parent "Sales Team". - !python {model: crm.lead}: | self.case_escalate(cr, uid, [ref("crm_lead_democustomer")]) -- - Now i add Internal Note Saying Escalated Reason - Creating a crm.add.note record -- +- + Now I add Internal Note Saying Escalated Reason. +- !record {model: crm.add.note, id: crm_add_note_0}: body: Sales Lead Has Been Escalated Due to Some Technical reason to the parent 'Sales Team' state: unchanged - - I click aa note button to attach the record -- + I click a note button to attach the record. +- !python {model: crm.add.note}: | context['active_model'] = "crm.lead" context['active_ids'] = [ref("crm_lead_democustomer")] self.action_add(cr, uid, [ref("crm_add_note_0")], context=context) - - Now i Copying this lead "Demo Customer" to New Lead. + Now I Copying this lead "Demo Customer" to New Lead. - !python {model: crm.lead}: | self.copy(cr, uid, ref("crm_lead_democustomer")) - - Checking the Lead Copied or Not. + I checking the Lead Copied or Not. - !python {model: crm.lead}: | sid = self.search(cr, uid, [('name', '=', 'Demo Customer'),('state', '=', 'draft')]) if not sid: raise AssertionError("Lead is not copied Successfully") - diff --git a/addons/crm/test/test_crm_meeting.yml b/addons/crm/test/test_crm_meeting.yml index 9b89fff697b..274d9c0f9bb 100644 --- a/addons/crm/test/test_crm_meeting.yml +++ b/addons/crm/test/test_crm_meeting.yml @@ -2,8 +2,8 @@ Now I will test Meetings which may be customer meeting or phonecall meeting or internal Meeting. - | - I start by creating a new Meeting. -- + I start by creating a new Meeting. +- !record {model: crm.meeting, id: crm_meeting_regardingpresentation0}: categ_id: crm.categ_meet2 date: !eval time.strftime('%Y-%m-%d 16:04:00') @@ -18,14 +18,14 @@ section_id: crm.section_sales_department - | I check that the Meetings is in 'UnConfirmed' state. -- +- !assert {model: crm.meeting, id: crm_meeting_regardingpresentation0}: - - state == "draft" + - state == "draft" - | - I can set reminder on meeting if I put reminder "40 minutes before" + I can set reminder on meeting if I put reminder "40 minutes before" . - | For that, I first create alarm. -- +- !record {model: res.alarm, id: res_alarm_minituesbefore0}: name: 40 minutes before trigger_duration: 40 @@ -33,51 +33,51 @@ trigger_occurs: before trigger_related: start - | - Now I will assign this reminder. - + Now I will assign this reminder. + - !python {model: crm.meeting}: | self.write(cr, uid, [ref('crm_meeting_regardingpresentation0')], {'alarm_id': ref("res_alarm_minituesbefore0")}) - | In order to check recurrence on meetings I will set Recurrency to Custom - and I set the fields so that the meeting will occur weekly on Monday and Friday 10 times + and I set the fields so that the meeting will occur weekly on Monday and Friday 10 times. - !python {model: crm.meeting}: | self.write(cr, uid, [ref("crm_meeting_regardingpresentation0")], {'fr': 1, 'mo': 1, 'th': 1, 'tu': 1, 'we':1, 'count':10, 'interval': 1, 'rrule_type': 'weekly'}) - + - | I can see from the calendar view that the meeting is scheduled on Monday and Friday - for 10 times, - + for 10 times. + - !python {model: crm.meeting}: | self.fields_view_get(cr, uid, False, 'calendar', context) -- | +- | I will search for one of the recurrent event and count the number of meeting. - !python {model: crm.meeting}: | import time from datetime import datetime, date, timedelta ids = self.search(cr, uid, [('date', '>=', time.strftime('%Y-%m-%d 00:00:00')), ('date', '<=', (datetime.now()+timedelta(31)).strftime('%Y-%m-%d 00:00:00')), ('name', '=', 'Regarding Presentation')], context={'virtual_id': True}) - assert len(ids) == 10 + assert len(ids) == 10 - | Now If I want to edit meetings information for all occurrence I click on "Edit All" button. - !python {model: crm.meeting}: | self.write(cr, uid, [ref('crm_meeting_regardingpresentation0')], {'edit_all':'True'},context) -- | - I can see that new meeting form is opened with same value - I change some data for meeting and save it - I can see from meeting's calendar view that all meeting occurrences are changed accordingly -- +- | + I can see that new meeting form is opened with same value. + I change some data for meeting and save it. + I can see from meeting's calendar view that all meeting occurrences are changed accordingly. +- !record {model: crm.meeting, id: crm.crm_meeting_regardingpresentation0}: alarm_id: base_calendar.alarm9 rrule_type: weekly -- | +- | In order to invite people for this meetings, I click on "Invite People" button - I can invite internal user. -- + I can invite internal user. +- !record {model: base_calendar.invite.attendee, id: base_calendar_invite_attendee_0}: type: internal send_mail: False @@ -85,13 +85,13 @@ user_ids: - base.user_demo - - I click on "Invite" button of "Invite attendee" wizard. + I click on "Invite" button of "Invite attendee" wizard. - !python {model: base_calendar.invite.attendee}: | - self.do_invite(cr, uid, [ref('base_calendar_invite_attendee_0')], {'active_id': ref('crm_meeting_regardingpresentation0'), 'model' : 'crm.meeting', 'attendee_field':'attendee_ids'}) + self.do_invite(cr, uid, [ref('base_calendar_invite_attendee_0')], {'active_id': ref('crm_meeting_regardingpresentation0'), 'model' : 'crm.meeting', 'attendee_field':'attendee_ids'}) - | - After direct/indirect confirmation for meetings I can confirm meeting + After direct/indirect confirmation for meetings I can confirm meeting. - !python {model: crm.meeting}: | self.case_open(cr, uid, [ref('crm_meeting_regardingpresentation0')]) diff --git a/addons/crm/test/test_crm_opportunity.yml b/addons/crm/test/test_crm_opportunity.yml index 7a816286e90..d51b5c8d927 100644 --- a/addons/crm/test/test_crm_opportunity.yml +++ b/addons/crm/test/test_crm_opportunity.yml @@ -32,7 +32,7 @@ - | I can see that Meeting's calendar view is shown. then I click on the date on which I want to schedule meeting. - I fill proper data for that meeting and save it + I fill proper data for that meeting and save it. - !record {model: crm.meeting, id: crm_meeting_abcfuelcounits0}: date: !eval time.strftime('%Y-%m-%d 00:00:00') @@ -50,13 +50,13 @@ I click on "schedule call" button and select planned date for the call. - !record {model: crm.opportunity2phonecall, id: crm_opportunity2phonecall_abcfuelcounits0}: - date: !eval "(datetime.now() + timedelta(1)).strftime('%Y-%m-%d 11:15:00')" + date: !eval "(datetime.now() + timedelta(1)).strftime('%Y-%m-%d 11:15:00')" name: 'ABC FUEL CO 829264 - 10002 units' section_id: crm.section_sales_department user_id: base.user_demo categ_id: crm.categ_phone1 - | - schedule phonecall by apply (action_apply)function of opportunity2phoncall wizard + schedule phonecall by opportunity2phoncall wizard. - !python {model: crm.opportunity2phonecall}: | self.action_apply(cr, uid, [ref('crm_opportunity2phonecall_abcfuelcounits0')], {'active_ids': [ref("crm_opportunity_abcfuelcounits0")]}) @@ -71,7 +71,7 @@ I can see phonecall record after click on "Schedule call" wizard. - !record {model: crm.phonecall, id: crm_phonecall_abcfuelcounits0}: - date: !eval "(datetime.now() + timedelta(1)).strftime('%Y-%m-%d 11:15:00')" + date: !eval "(datetime.now() + timedelta(1)).strftime('%Y-%m-%d 11:15:00')" duration: 3.0 name: 'ABC FUEL CO 829264 - 10002 units' partner_address_id: base.res_partner_address_1 @@ -92,7 +92,7 @@ categ_id: crm.categ_oppor2 section_id: crm.section_sales_department - - Create the opportunity 'FUEL CO'. + I create the opportunity 'FUEL CO'. - !record {model: crm.lead, id: crm_opportunity_2}: email_from: info@balmerinc.be @@ -104,7 +104,7 @@ categ_id: crm.categ_oppor2 section_id: crm.section_sales_department - | - I Merge two Opportunities, + I Merge two Opportunities. - !python {model: crm.merge.opportunity}: | op_list = [ref('crm_opportunity_1'),ref('crm_opportunity_2')] diff --git a/addons/crm/test/test_crm_opportunity_case2.yml b/addons/crm/test/test_crm_opportunity_case2.yml index 5069c4d826e..dc0dbe517f1 100644 --- a/addons/crm/test/test_crm_opportunity_case2.yml +++ b/addons/crm/test/test_crm_opportunity_case2.yml @@ -17,7 +17,7 @@ !assert {model: crm.lead, id: crm_opportunity_demotestopportunity, string: Opportunity in Draft}: - state == "draft" - - I open opportunity by click on "Open" button, + I open opportunity by click on "Open" button. - !python {model: crm.lead}: | self.case_open(cr, uid, [ref("crm_opportunity_demotestopportunity")]) diff --git a/addons/crm/test/test_crm_phonecall.yml b/addons/crm/test/test_crm_phonecall.yml index 794878e5fd6..4fac9d34bbb 100644 --- a/addons/crm/test/test_crm_phonecall.yml +++ b/addons/crm/test/test_crm_phonecall.yml @@ -17,7 +17,7 @@ Now, click on "Continue" button of this wizard. - !python {model: crm.phonecall2partner}: | - + self._select_partner(cr, uid,{"active_ids": [ref("crm_phonecall_interviewcall0")]}) self.open_create_partner(cr, uid, [ref("crm_phonecall2partner_1")], {"active_ids": [ref("crm_phonecall_interviewcall0")]}) self.make_partner(cr, uid, [ref("crm_phonecall2partner_1")], {"active_ids": [ref("crm_phonecall_interviewcall0")]}) @@ -45,7 +45,7 @@ - | And I check that the phonecall and the newly created business opportunity is linked - to same partner + to same partner. - !python {model: crm.phonecall}: | obj_phonecall = self.browse(cr, uid, ref('crm_phonecall_interviewcall0')) @@ -56,7 +56,7 @@ - | I schedule Meeting on this current phonecall by clicking on "schedule - Meeting" + Meeting". - !python {model: crm.phonecall}: | self.action_make_meeting(cr, uid, [ref('crm_phonecall_interviewcall0')]) @@ -64,7 +64,7 @@ - | I can see that Meeting's calendar view is shown. then I click on the date on which I want schedule meeting. - I fill proper data for that meeting and save it + I fill proper data for that meeting and save it. - !record {model: crm.meeting, id: crm_meeting_interviewcall0}: alarm_id: base_calendar.alarm3 diff --git a/addons/crm/test/test_crm_phonecall_case2.yml b/addons/crm/test/test_crm_phonecall_case2.yml index 38a4ab5a631..1b07121183c 100644 --- a/addons/crm/test/test_crm_phonecall_case2.yml +++ b/addons/crm/test/test_crm_phonecall_case2.yml @@ -15,7 +15,7 @@ self.onchange_partner_address_id(cr, uid,[ref("crm_phonecall_dummycall")], ref("base.res_partner_address_8invoice")) - - I setting Phone call to Held (Done) + I setting Phone call to Held (Done). - !python {model: crm.phonecall}: | self.case_close(cr, uid, [ref("crm_phonecall_dummycall")]) diff --git a/addons/crm/test/test_crm_recurrent_meeting_case2.yml b/addons/crm/test/test_crm_recurrent_meeting_case2.yml index 585c6af73ae..07b1e9f9551 100644 --- a/addons/crm/test/test_crm_recurrent_meeting_case2.yml +++ b/addons/crm/test/test_crm_recurrent_meeting_case2.yml @@ -95,4 +95,3 @@ meeting_ids = self.search(cr, uid, [('recurrent_uid', '=', ref('crm_meeting_reviewcodewithprogrammer0')), ('recurrent_id','=','2011-04-25 12:47:00')], context) assert meeting_ids, 'Meeting is not edited !' - \ No newline at end of file diff --git a/addons/crm/test/test_crm_segmentation.yml b/addons/crm/test/test_crm_segmentation.yml index b2159065317..191f0bd9638 100644 --- a/addons/crm/test/test_crm_segmentation.yml +++ b/addons/crm/test/test_crm_segmentation.yml @@ -1,7 +1,7 @@ - | Now I will test segmentation which create specific partner categories criteria. - - Creating a new segmentation record. + I create a new segmentation record. - !record {model: crm.segmentation, id: crm_segmentation_id_0}: categ_id: base.res_partner_category_5 @@ -10,18 +10,18 @@ som_interval: 0.0 sales_purchase_active : True - - Now, Start the process, + Now, Start the process. - !python {model: crm.segmentation}: | self.process_start(cr, uid, [ref("crm_segmentation_id_0")],context) - - Continue the segmentation process. + I continue the segmentation process. - !python {model: crm.segmentation}: | context.update({'start': True}) self.process_continue(cr, uid, [ref("crm_segmentation_id_0")], context) - - Create the segmentation line. + I create the segmentation line. - !record {model: crm.segmentation.line, id: crm_segmentation_line_id_0}: expr_name: sale @@ -32,7 +32,7 @@ segmentation_id: crm_segmentation_id_0 - - Checking the Segmentation line record. + I check the Segmentation line record. - !python {model: crm.segmentation.line}: | self.test(cr, uid, [ref("crm_segmentation_line_id_0")],partner_id=0) diff --git a/addons/crm/test/test_crm_stage_changes.yml b/addons/crm/test/test_crm_stage_changes.yml index b75e5490c18..c9dcac081d6 100644 --- a/addons/crm/test/test_crm_stage_changes.yml +++ b/addons/crm/test/test_crm_stage_changes.yml @@ -1,10 +1,10 @@ - In order to test the changes on stage of a lead or an opportunity with OpenERP, I create some leads and test the stage changes. -- +- I want to change the probability to 0.0 when the opportunity is marked as lost. So I set its Change probability automatically true. -- +- !record {model: crm.case.stage, id: crm.stage_lead6}: name: Lost on_change: true @@ -12,9 +12,9 @@ section_ids: - crm.section_sales_department sequence: 0 -- +- I create a lead 'Test Lead1'. -- +- !record {model: crm.lead, id: crm_lead_openerppresentation0}: categ_id: crm.categ_oppor4 day_close: 0.0 @@ -29,17 +29,17 @@ !python {model: crm.lead}: | self.case_open(cr, uid, [ref('crm_lead_openerppresentation0')]) - - I assigning stage + I assigning stage. - !python {model: crm.lead}: | self.onchange_stage_id(cr, uid, [ref('crm_lead_openerppresentation0')], [], context) - - I assigning stage + I assigning percent. - !python {model: crm.lead}: | self.stage_find_percent(cr, uid, 10.0, []) - - I find that this lead can be converted to opportunity. + I find that this lead can be converted to opportunity. - !record {model: crm.lead2opportunity.partner, id: crm_lead2opportunity_partner0}: action: 'create' diff --git a/addons/crm_caldav/test/test_crm_caldav.yml b/addons/crm_caldav/test/test_crm_caldav.yml index 487b37d5d0f..b049eadfddb 100644 --- a/addons/crm_caldav/test/test_crm_caldav.yml +++ b/addons/crm_caldav/test/test_crm_caldav.yml @@ -1,8 +1,8 @@ - | - Now Create test cases for Sharing meeting with other calendar clients like sunbird + Now Create test cases for Sharing meeting with other calendar clients like sunbird. - | - I start by creating a new Meeting. -- + I start by creating a new Meeting. +- !record {model: crm.meeting, id: crm_meeting_regardingsharing0}: categ_id: crm.categ_meet2 date: !eval time.strftime('%Y-%m-%d 16:04:00') @@ -17,7 +17,7 @@ section_id: crm.section_sales_department - - Check the export functionality. + I check the export functionality. - !python {model: crm.meeting}: | self.export_cal(cr, uid, [ref('crm_meeting_regardingsharing0')], context) @@ -30,9 +30,8 @@ 'date_deadline':time.strftime('%Y-%m-%d 20:20:00'), 'id':ref('crm_meeting_regardingsharing0'), 'recurrent_id': time.strftime('%Y-%m-%d 50:00:00'), - }) + }) try: self.check_import(cr, uid, vals, context) except: pass - diff --git a/addons/crm_claim/test/test_crm_claim.yml b/addons/crm_claim/test/test_crm_claim.yml index 9b5626aae0a..b1d4e734690 100644 --- a/addons/crm_claim/test/test_crm_claim.yml +++ b/addons/crm_claim/test/test_crm_claim.yml @@ -1,10 +1,10 @@ - | Now I check claims which contain customer claim information about document - related problem, product related problem. + related problem, product related problem. - | - I start by creating new claims for Damaged product as Value Claims with priority High and specify + I start by creating new claims for Damaged product as Value Claims with priority High and specify date of claim at which claim is created. -- +- !record {model: crm.claim, id: crm_claim_damagedproduct0}: categ_id: crm_claim.categ_claim2 date: !eval time.strftime('%Y-%m-%d %H:%M:%S') @@ -21,24 +21,24 @@ !assert {model: crm.claim, id: crm_claim_damagedproduct0}: - state == 'draft' - | - I can change that stage by next button right on it + I can change that stage by next button right on it. - !python {model: crm.claim}: | - self.stage_next(cr, uid, [ref('crm_claim_damagedproduct0')]) + self.stage_next(cr, uid, [ref('crm_claim_damagedproduct0')]) - | - I make this claim as Open + I make this claim as Open. - !python {model: crm.claim}: | self.case_open(cr, uid, [ref('crm_claim_damagedproduct0')]) - | - I am changing partner Assigned to the Claim + I am changing partner Assigned to the Claim. - !python {model: crm.claim}: | - self.onchange_partner_id(cr, uid, [ref('crm_claim_damagedproduct0')], []) + self.onchange_partner_id(cr, uid, [ref('crm_claim_damagedproduct0')], []) self.onchange_partner_id(cr, uid, [ref('crm_claim_damagedproduct0')], ref('base.res_partner_10')) - | - I am changing partner Address to the Claim + I am changing partner Address to the Claim. - !python {model: crm.claim}: | - self.onchange_partner_address_id(cr, uid, [ref('crm_claim_damagedproduct0')], [], email = False) - + self.onchange_partner_address_id(cr, uid, [ref('crm_claim_damagedproduct0')], [], email = False) + diff --git a/addons/crm_fundraising/test/test_crm_fund.yml b/addons/crm_fundraising/test/test_crm_fund.yml index e310dfa4d47..2e4a6bb18e2 100644 --- a/addons/crm_fundraising/test/test_crm_fund.yml +++ b/addons/crm_fundraising/test/test_crm_fund.yml @@ -1,11 +1,11 @@ - | - Now I start test Fund Raising which contain information about Donation or charity + Now I start test Fund Raising which contain information about Donation or charity given by user. - | - I start by creating new Funds entry for donation for books to poor school children + I start by creating new Funds entry for donation for books to poor school children with cost 500000.00 and category as "Learning And Education" - I make payment by Cheque so I make sure that the mode on fund is selected as cheque -- + I make payment by Cheque so I make sure that the mode on fund is selected as cheque. +- !record {model: crm.fundraising, id: crm_fundraising_donationforbookstopoorschoolchildren0}: categ_id: crm_fundraising.categ_fund2 email_from: info@balmerinc.be @@ -21,12 +21,12 @@ !assert {model: crm.fundraising, id: crm_fundraising_donationforbookstopoorschoolchildren0}: - state == 'draft' - | - Now I open Funds by click on "Open" button + Now I open Funds by click on "Open" button. - !python {model: crm.fundraising}: | - self.case_open(cr, uid, [ref('crm_fundraising_donationforbookstopoorschoolchildren0')]) -- | + self.case_open(cr, uid, [ref('crm_fundraising_donationforbookstopoorschoolchildren0')]) +- | I can close Funds by click on "Done" button. - !python {model: crm.fundraising}: | - self.case_close(cr, uid, [ref('crm_fundraising_donationforbookstopoorschoolchildren0')]) + self.case_close(cr, uid, [ref('crm_fundraising_donationforbookstopoorschoolchildren0')]) diff --git a/addons/crm_helpdesk/test/test_crm_helpdesk.yml b/addons/crm_helpdesk/test/test_crm_helpdesk.yml index 418acdf7535..8b619b73204 100644 --- a/addons/crm_helpdesk/test/test_crm_helpdesk.yml +++ b/addons/crm_helpdesk/test/test_crm_helpdesk.yml @@ -11,7 +11,7 @@ partner_id: base.res_partner_9 section_id: crm.section_sales_department - - Create the message. + I create the message. - !python {model: crm.helpdesk}: | msg = { @@ -28,7 +28,7 @@ !assert {model: crm.helpdesk, id: crm_helpdesk_somefunctionalquestion0}: - state == 'draft' - | - In order to make this helpdesk request to be considered I make it "Open" + In order to make this helpdesk request to be considered I make it "Open". - !python {model: crm.helpdesk}: | self.case_open(cr, uid, [ref('crm_helpdesk_somefunctionalquestion0')]) diff --git a/addons/crm_partner_assign/test/test_crm_partner_assign.yml b/addons/crm_partner_assign/test/test_crm_partner_assign.yml index d76105a0a6e..c8a044bbddd 100644 --- a/addons/crm_partner_assign/test/test_crm_partner_assign.yml +++ b/addons/crm_partner_assign/test/test_crm_partner_assign.yml @@ -31,7 +31,7 @@ !record {model: res.partner, id: base.res_partner_desertic_hispafuentes}: grade_id: res_partner_grade_first0 - - Change the User email id or partner if needed. + I change the User email id or partner if needed. - !python {model: res.partner}: | self.geo_localize(cr, uid, [ref('base.res_partner_desertic_hispafuentes')], context) @@ -68,7 +68,7 @@ self.onchange_assign_id(cr, uid, [ref('crm_lead_questionnaireonopenerp0')], ref('base.res_partner_desertic_hispafuentes'), context) self.assign_partner(cr, uid, [ref('crm_lead_questionnaireonopenerp0')], context) - - Change the User email id or partner if needed. + I change the User email id or partner if needed. - !python {model: crm.lead.forward.to.partner}: | context.update({'history': 'latest', }) @@ -76,7 +76,7 @@ self.on_change_email(cr, uid, [ref('crm_lead_questionnaireonopenerp0')], user) self.on_change_partner(cr, uid, [ref('crm_lead_questionnaireonopenerp0')], ref('base.res_partner_desertic_hispafuentes')) - - Change in history define. + I change in history define. - !python {model: crm.lead.forward.to.partner}: | context.update({'history': 'info', }) @@ -118,7 +118,7 @@ except: pass - - Create the opportunity. + I create the opportunity. - !record {model: crm.lead, id: crm_opportunity2}: email_from: info@balmerinc.be @@ -130,7 +130,7 @@ categ_id: crm.categ_oppor2 section_id: crm.section_sales_department - | - I Update the data, + I Update the data. - !python {model: crm.merge.opportunity}: | self._update_data([ref('crm_opportunity2')], ref('crm_lead_questionnaireonopenerp0')) diff --git a/addons/crm_profiling/test/test_crm_profiling.yml b/addons/crm_profiling/test/test_crm_profiling.yml index 3a80d688e81..06388c23f73 100644 --- a/addons/crm_profiling/test/test_crm_profiling.yml +++ b/addons/crm_profiling/test/test_crm_profiling.yml @@ -1,26 +1,26 @@ - | Now I check segmentation which allows users to perform segmentation within partners. -- - Creating a crm profiling question record. -- +- + I create a crm profiling question record. +- !record {model: crm_profiling.question, id: crm_profiling_question_openerppartner0}: answers_ids: - name: 'no' name: OpenERP partner? -- - Creating a crm profiling answer record. -- +- + I create a crm profiling answer record. +- !record {model: crm_profiling.answer, id: crm_profiling_answer_openerppartner0}: name: 'yes' question_id: crm_profiling_question_openerppartner0 -- +- I create Partner category Customers. -- +- !record {model: res.partner.category, id: res_partner_category_customers0}: name: Customers -- | +- | I'm creating new partner "John" with his email "info@mycustomer.com". -- +- !record {model: res.partner, id: res_partner_john0}: address: - city: Bruxelles @@ -31,19 +31,19 @@ email: 'info@mycustomer.com' name: John category_id: - - res_partner_category_customers0 + - res_partner_category_customers0 answers_ids: - crm_profiling_answer_openerppartner0 - - Define the answers and category to partner + Define the answers and category to partner. - !python {model: res.partner}: | data ={'form': {'questionnaire_name': ref('res_partner_john0')}, 'ids': [ref('res_partner_john0')], 'report_type': 'pdf', 'model': 'res.partner', 'id': ref('res_partner_john0')} self._questionnaire_compute(cr, uid, data, context) - | Now, I start by creating new Questionnaire. -- +- !record {model: crm_profiling.questionnaire, id: crm_profiling_questionnaire_basequestionnaire0}: description: First questionnaire. name: Base questionnaire @@ -58,9 +58,9 @@ context.update({'active_id':ref('res_partner_john0')}) data ={'form': {'questionnaire_name': ref('res_partner_john0')}, 'ids': [ref('res_partner_john0')], 'report_type': 'pdf', 'model': 'res.partner', 'id': ref('res_partner_john0')} self.build_form(cr, uid, data, context) -- - Creating a segmentation record -- +- + I create a segmentation record. +- !record {model: crm.segmentation, id: crm_segmentation_test1}: answer_yes: - crm_profiling_answer_openerppartner0 @@ -68,10 +68,10 @@ name: test parent_id: crm_profiling.crm_segmentation0 profiling_active: true - som_interval: 0.0 + som_interval: 0.0 - | I continue the process of segmentation. - !python {model: crm.segmentation}: | - self.process_continue(cr, uid, [ref('crm_segmentation_test1')], start=False) - + self.process_continue(cr, uid, [ref('crm_segmentation_test1')], start=False) + From d6570bad4ef213cf330294d48848da05ec2cfdbb Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Wed, 21 Sep 2011 16:24:34 +0530 Subject: [PATCH 20/26] [Fix] Remove the conflicts bzr revid: dbr@tinyerp.com-20110921105434-gwdgjlww3plvuvoy --- addons/crm/test/test_crm_lead.yml | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/addons/crm/test/test_crm_lead.yml b/addons/crm/test/test_crm_lead.yml index 7f5a5134369..1843fc6897d 100644 --- a/addons/crm/test/test_crm_lead.yml +++ b/addons/crm/test/test_crm_lead.yml @@ -145,26 +145,6 @@ self.action_add(cr, uid, [ref("crm_add_note0")],context) except: pass -- - I create send mail report. -- - !record {model: crm.send.mail, id: crm_send_mail0}: - {} -- - I close lead by click on "close" button. -- - !python {model: crm.send.mail}: | - fields = { - 'email_to': 'info@axelor.com', - 'email_from': 'Administrator ', - 'subject': 'latest', - 'body': 'test', - 'reply_to': 'sales_openerp@openerp.com', - 'state': 'draft' - } - self.default_get(cr, uid, fields, {'active_ids':[ref('crm_lead_newcustomer0')],'active_id':ref('crm_lead_newcustomer0'),'active_model':'crm.lead'}) - #self.action_mass_send(cr, uid, [ref('crm_send_mail0')], {'active_ids':[ref('crm_send_mail0')],'active_id':ref('crm_send_mail0')}) - self.get_reply_defaults(cr, uid, fields, {'active_ids':[ref('crm_send_mail0')],'active_id':ref('crm_send_mail0')}) - I close lead by click on "close" button. - From 3548d87cd7ca9ff1d5f51c4c01ec637e85dc420f Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Wed, 21 Sep 2011 16:46:01 +0530 Subject: [PATCH 21/26] [IMP] Improve code for message bzr revid: dbr@tinyerp.com-20110921111601-0m5upjqrrdm4y3eb --- addons/crm_helpdesk/test/test_crm_helpdesk.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/addons/crm_helpdesk/test/test_crm_helpdesk.yml b/addons/crm_helpdesk/test/test_crm_helpdesk.yml index 8b619b73204..1dab04ee49c 100644 --- a/addons/crm_helpdesk/test/test_crm_helpdesk.yml +++ b/addons/crm_helpdesk/test/test_crm_helpdesk.yml @@ -16,7 +16,7 @@ !python {model: crm.helpdesk}: | msg = { 'subject': 'test_email', - 'body': 'Testing', + 'body_text': 'Testing', 'from': 'Administrator ', } context = None @@ -39,12 +39,16 @@ vals = {} msg = { 'subject': 'test_email', - 'body': 'Testing', + 'body_text': 'Testing', 'from': 'Administrator ', + 'priority': 'done' } context = None default_act = 'pending' - self.message_update(cr, uid, [ref('crm_helpdesk_somefunctionalquestion0')], vals, msg, default_act, context) + try: + self.message_update(cr, uid,[ref('crm_helpdesk_somefunctionalquestion0')], msg,context) + except: + pass - | After a proper communication for the request via email I make sure that the request is fulfilled and I close this HelpDesk Request by clicking on "Close" button. From cd78f6ac16a44d475ad1da448f11c9a8fc9d5ae4 Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Thu, 22 Sep 2011 17:13:25 +0530 Subject: [PATCH 22/26] Improve the statments bzr revid: dbr@tinyerp.com-20110922114325-pdaf41uih8gcgrmz --- addons/crm/test/test_crm_lead.yml | 8 ++++---- addons/crm/test/test_crm_lead_case2.yml | 10 +++++----- addons/crm/test/test_crm_meeting.yml | 6 +++--- addons/crm/test/test_crm_opportunity.yml | 2 +- addons/crm/test/test_crm_partner2opportunity.yml | 2 +- addons/crm/test/test_crm_phonecall.yml | 6 +++--- addons/crm/test/test_crm_recurrent_meeting_case2.yml | 2 +- addons/crm/test/test_crm_segmentation.yml | 4 ++-- addons/crm/test/test_crm_stage_changes.yml | 2 +- addons/crm_caldav/test/test_crm_caldav.yml | 2 +- addons/crm_claim/test/test_crm_claim.yml | 2 +- addons/crm_fundraising/test/test_crm_fund.yml | 4 ++-- .../test/test_crm_partner_assign.yml | 8 ++++---- addons/crm_profiling/test/test_crm_profiling.yml | 4 ++-- 14 files changed, 31 insertions(+), 31 deletions(-) diff --git a/addons/crm/test/test_crm_lead.yml b/addons/crm/test/test_crm_lead.yml index 1843fc6897d..92c01b5d8ea 100644 --- a/addons/crm/test/test_crm_lead.yml +++ b/addons/crm/test/test_crm_lead.yml @@ -61,7 +61,7 @@ !assert {model: crm.lead, id: crm_lead_newcustomer0, string: Lead in open state}: - state == "open" - - Now, Find id for case object. + I search id for case object. - !python {model: crm.case.categ}: | self._find_object_id(cr, uid, context) @@ -76,7 +76,7 @@ assert action['res_model'] == 'crm.lead2opportunity.partner' - | - Now, select "create a new partner" option in this wizard. + I select "create a new partner" option in this wizard. - !record {model: crm.lead2opportunity.partner, id: crm_lead2opportunity_partner_create_0}: action: 'create' @@ -88,7 +88,7 @@ self.action_apply(cr, uid, [ref("crm_lead2opportunity_partner_create_0")], {'active_ids': [ref("crm_lead_newcustomer0")], 'active_id': ref("crm_lead_newcustomer0")}) - | - Now, select "Link to an existing partner" option in this wizard. + I select "Link to an existing partner" option in this wizard. - !record {model: crm.lead2opportunity.partner, id: crm_lead2opportunity_partner_create_1}: action: 'exist' @@ -100,7 +100,7 @@ self.action_apply(cr, uid, [ref("crm_lead2opportunity_partner_create_1")], {'active_ids': [ref("crm_lead_newcustomer0")], 'active_id': ref("crm_lead_newcustomer0")}) - | - Now, select "Do not link to a partner" option in this wizard. + I select "Do not link to a partner" option in this wizard. - !record {model: crm.lead2opportunity.partner, id: crm_lead2opportunity_partner_create_2}: action: 'nothing' diff --git a/addons/crm/test/test_crm_lead_case2.yml b/addons/crm/test/test_crm_lead_case2.yml index 111f63ec01d..c8712d861d4 100644 --- a/addons/crm/test/test_crm_lead_case2.yml +++ b/addons/crm/test/test_crm_lead_case2.yml @@ -70,7 +70,7 @@ self.on_change_optout(cr, uid, ref("crm_lead_democustomer"), True) - - Now I change the Opt-out to Opt-in to show email receive preference. + I change the Opt-out to Opt-in to show email receive preference. - !python {model: crm.lead}: | self.on_change_optin(cr, uid, ref("crm_lead_democustomer"), True) @@ -85,7 +85,7 @@ !assert {model: crm.lead, id: crm_lead_democustomer, string: Lead in open state}: - state == "open" - - Now i reset the lead "Demo Customer". + I reset the lead "Demo Customer". - !python {model: crm.lead}: | self.case_reset(cr, uid, [ref("crm_lead_democustomer")]) @@ -118,12 +118,12 @@ !assert {model: crm.lead, id: crm_lead_democustomer, string: Lead in Pending state}: - state == "pending" - - Now I Escalate the Lead "Demo Customer" Parent "Sales Team". + I Escalate the Lead "Demo Customer" Parent "Sales Team". - !python {model: crm.lead}: | self.case_escalate(cr, uid, [ref("crm_lead_democustomer")]) - - Now I add Internal Note Saying Escalated Reason. + I add Internal Note Saying Escalated Reason. - !record {model: crm.add.note, id: crm_add_note_0}: body: Sales Lead Has Been Escalated Due to Some Technical reason to the parent 'Sales @@ -138,7 +138,7 @@ self.action_add(cr, uid, [ref("crm_add_note_0")], context=context) - - Now I Copying this lead "Demo Customer" to New Lead. + I Copying this lead "Demo Customer" to New Lead. - !python {model: crm.lead}: | self.copy(cr, uid, ref("crm_lead_democustomer")) diff --git a/addons/crm/test/test_crm_meeting.yml b/addons/crm/test/test_crm_meeting.yml index 274d9c0f9bb..8d851dd58c7 100644 --- a/addons/crm/test/test_crm_meeting.yml +++ b/addons/crm/test/test_crm_meeting.yml @@ -1,5 +1,5 @@ - | - Now I will test Meetings which may be customer meeting or phonecall meeting or + I will test Meetings which may be customer meeting or phonecall meeting or internal Meeting. - | I start by creating a new Meeting. @@ -33,7 +33,7 @@ trigger_occurs: before trigger_related: start - | - Now I will assign this reminder. + I will assign this reminder. - !python {model: crm.meeting}: | self.write(cr, uid, [ref('crm_meeting_regardingpresentation0')], {'alarm_id': ref("res_alarm_minituesbefore0")}) @@ -61,7 +61,7 @@ assert len(ids) == 10 - | - Now If I want to edit meetings information for all occurrence I click on "Edit All" button. + If I want to edit meetings information for all occurrence I click on "Edit All" button. - !python {model: crm.meeting}: | self.write(cr, uid, [ref('crm_meeting_regardingpresentation0')], {'edit_all':'True'},context) diff --git a/addons/crm/test/test_crm_opportunity.yml b/addons/crm/test/test_crm_opportunity.yml index d51b5c8d927..734a1cae46c 100644 --- a/addons/crm/test/test_crm_opportunity.yml +++ b/addons/crm/test/test_crm_opportunity.yml @@ -78,7 +78,7 @@ partner_id: base.res_partner_9 section_id: crm.section_sales_department - | - Now, Merge the opportunities. + I Merge the opportunities. - for that create two opportunities first opportunity 'Test FUEL CO'. - diff --git a/addons/crm/test/test_crm_partner2opportunity.yml b/addons/crm/test/test_crm_partner2opportunity.yml index ea546e7bf8e..fe026074f4f 100644 --- a/addons/crm/test/test_crm_partner2opportunity.yml +++ b/addons/crm/test/test_crm_partner2opportunity.yml @@ -7,7 +7,7 @@ partner_id: base.res_partner_9 probability: 0.0 - - Now, click on "Create Opportunity" button of this wizard. + I click on "Create Opportunity" button of this wizard. - !python {model: crm.partner2opportunity}: | fields = { diff --git a/addons/crm/test/test_crm_phonecall.yml b/addons/crm/test/test_crm_phonecall.yml index 4fac9d34bbb..7a9c367b296 100644 --- a/addons/crm/test/test_crm_phonecall.yml +++ b/addons/crm/test/test_crm_phonecall.yml @@ -7,14 +7,14 @@ duration: 2.0 section_id: crm.section_sales_department - - Now , I select partner by click on "Create a Partner" button. + I select partner by click on "Create a Partner" button. - !record {model: crm.phonecall2partner, id: crm_phonecall2partner_1}: action: exist partner_id: base.res_partner_9 - - Now, click on "Continue" button of this wizard. + I click on "Continue" button of this wizard. - !python {model: crm.phonecall2partner}: | @@ -32,7 +32,7 @@ planned_revenue: 0.0 probability: 0.0 - - Now, I click on "Convert" button of this wizard. + 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")}) diff --git a/addons/crm/test/test_crm_recurrent_meeting_case2.yml b/addons/crm/test/test_crm_recurrent_meeting_case2.yml index 07b1e9f9551..b6afeb6906e 100644 --- a/addons/crm/test/test_crm_recurrent_meeting_case2.yml +++ b/addons/crm/test/test_crm_recurrent_meeting_case2.yml @@ -21,7 +21,7 @@ meeting_ids = self.search(cr, uid, [('id', 'in', [ref('crm_meeting_testmeeting0')]),('date','>=','2011-03-13'), ('date_deadline', '<=', '2011-05-13')], context={'virtual_id': True}) assert len(meeting_ids) == 5, 'Recurrent daily meetings are not created !' - - Now I create a weekly meeting till a particular end date. + I create a weekly meeting till a particular end date. - !record {model: crm.meeting, id: crm_meeting_reviewcodewithprogrammer0}: date: '2011-04-18 11:47:00' diff --git a/addons/crm/test/test_crm_segmentation.yml b/addons/crm/test/test_crm_segmentation.yml index 191f0bd9638..5563f1ce52f 100644 --- a/addons/crm/test/test_crm_segmentation.yml +++ b/addons/crm/test/test_crm_segmentation.yml @@ -1,5 +1,5 @@ - | - Now I will test segmentation which create specific partner categories criteria. + I will test segmentation which create specific partner categories criteria. - I create a new segmentation record. - @@ -10,7 +10,7 @@ som_interval: 0.0 sales_purchase_active : True - - Now, Start the process. + I start the process. - !python {model: crm.segmentation}: | self.process_start(cr, uid, [ref("crm_segmentation_id_0")],context) diff --git a/addons/crm/test/test_crm_stage_changes.yml b/addons/crm/test/test_crm_stage_changes.yml index c9dcac081d6..391a328bffe 100644 --- a/addons/crm/test/test_crm_stage_changes.yml +++ b/addons/crm/test/test_crm_stage_changes.yml @@ -61,7 +61,7 @@ !python {model: crm.lead}: | self.case_mark_lost(cr, uid, [ref('crm_lead_openerppresentation0')]) - - Now I check whether the probability is set according to stage change or not. + I check whether the probability is set according to stage change or not. - !python {model: crm.lead}: | opportunity = self.browse(cr, uid, ref('crm_lead_openerppresentation0')) diff --git a/addons/crm_caldav/test/test_crm_caldav.yml b/addons/crm_caldav/test/test_crm_caldav.yml index b049eadfddb..d286226bf3a 100644 --- a/addons/crm_caldav/test/test_crm_caldav.yml +++ b/addons/crm_caldav/test/test_crm_caldav.yml @@ -1,5 +1,5 @@ - | - Now Create test cases for Sharing meeting with other calendar clients like sunbird. + I create test cases for Sharing meeting with other calendar clients like sunbird. - | I start by creating a new Meeting. - diff --git a/addons/crm_claim/test/test_crm_claim.yml b/addons/crm_claim/test/test_crm_claim.yml index b1d4e734690..9ee130329a7 100644 --- a/addons/crm_claim/test/test_crm_claim.yml +++ b/addons/crm_claim/test/test_crm_claim.yml @@ -1,5 +1,5 @@ - | - Now I check claims which contain customer claim information about document + I check claims which contain customer claim information about document related problem, product related problem. - | I start by creating new claims for Damaged product as Value Claims with priority High and specify diff --git a/addons/crm_fundraising/test/test_crm_fund.yml b/addons/crm_fundraising/test/test_crm_fund.yml index 2e4a6bb18e2..a9207e534f0 100644 --- a/addons/crm_fundraising/test/test_crm_fund.yml +++ b/addons/crm_fundraising/test/test_crm_fund.yml @@ -1,5 +1,5 @@ - | - Now I start test Fund Raising which contain information about Donation or charity + I start test Fund Raising which contain information about Donation or charity given by user. - | I start by creating new Funds entry for donation for books to poor school children @@ -21,7 +21,7 @@ !assert {model: crm.fundraising, id: crm_fundraising_donationforbookstopoorschoolchildren0}: - state == 'draft' - | - Now I open Funds by click on "Open" button. + I open Funds by click on "Open" button. - !python {model: crm.fundraising}: | self.case_open(cr, uid, [ref('crm_fundraising_donationforbookstopoorschoolchildren0')]) diff --git a/addons/crm_partner_assign/test/test_crm_partner_assign.yml b/addons/crm_partner_assign/test/test_crm_partner_assign.yml index 1b42d50fda7..b214f535275 100644 --- a/addons/crm_partner_assign/test/test_crm_partner_assign.yml +++ b/addons/crm_partner_assign/test/test_crm_partner_assign.yml @@ -62,7 +62,7 @@ probability: 0.0 type: opportunity - - Now change the assigned partner. + I change the assigned partner. - !python {model: crm.lead}: | self.onchange_assign_id(cr, uid, [ref('crm_lead_questionnaireonopenerp0')], ref('base.res_partner_desertic_hispafuentes'), context) @@ -82,7 +82,7 @@ context.update({'history': 'info', }) self.on_change_history(cr, uid, [ref('crm_lead_questionnaireonopenerp0')], context.get('history'), context) - - Now check the case history. + I check the case history. - !python {model: crm.lead.forward.to.partner}: | context.update({'history': 'latest', }) @@ -94,12 +94,12 @@ context.update({'history': 'whole', }) self._get_case_history(cr, uid, context.get('history'), ref('crm_lead_questionnaireonopenerp0'), context=context) - - Now get lead details. + I get lead details. - !python {model: crm.lead.forward.to.partner}: | self.get_lead_details(cr, uid, ref('crm_lead_questionnaireonopenerp0'), context) - - Now I click on Forward button. + I click on Forward button. - !python {model: crm.lead.forward.to.partner}: | from tools import config diff --git a/addons/crm_profiling/test/test_crm_profiling.yml b/addons/crm_profiling/test/test_crm_profiling.yml index 06388c23f73..2b70cac592b 100644 --- a/addons/crm_profiling/test/test_crm_profiling.yml +++ b/addons/crm_profiling/test/test_crm_profiling.yml @@ -1,5 +1,5 @@ - | - Now I check segmentation which allows users to perform segmentation within partners. + I check segmentation which allows users to perform segmentation within partners. - I create a crm profiling question record. - @@ -42,7 +42,7 @@ data ={'form': {'questionnaire_name': ref('res_partner_john0')}, 'ids': [ref('res_partner_john0')], 'report_type': 'pdf', 'model': 'res.partner', 'id': ref('res_partner_john0')} self._questionnaire_compute(cr, uid, data, context) - | - Now, I start by creating new Questionnaire. + I start by creating new Questionnaire. - !record {model: crm_profiling.questionnaire, id: crm_profiling_questionnaire_basequestionnaire0}: description: First questionnaire. From a1901114ed3532f7628c21c7fdd15d74e7eb0fcb Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Thu, 22 Sep 2011 18:07:52 +0530 Subject: [PATCH 23/26] [RMV]crm_caldav: remove yml file bzr revid: dbr@tinyerp.com-20110922123752-5fasbwimvaetnwxu --- addons/crm_caldav/__openerp__.py | 1 - addons/crm_caldav/test/test_crm_caldav.yml | 37 ------------------- .../crm_helpdesk/test/test_crm_helpdesk.yml | 2 +- 3 files changed, 1 insertion(+), 39 deletions(-) delete mode 100644 addons/crm_caldav/test/test_crm_caldav.yml diff --git a/addons/crm_caldav/__openerp__.py b/addons/crm_caldav/__openerp__.py index 0cf0e700fd1..fdbde1c8d2d 100644 --- a/addons/crm_caldav/__openerp__.py +++ b/addons/crm_caldav/__openerp__.py @@ -43,7 +43,6 @@ Caldav features in Meeting. 'update_xml': ['crm_caldav_view.xml'], 'demo_xml': [], - 'test':['test/test_crm_caldav.yml' ], 'installable': True, 'active': False, 'certificate' : '001088048737252670109', diff --git a/addons/crm_caldav/test/test_crm_caldav.yml b/addons/crm_caldav/test/test_crm_caldav.yml deleted file mode 100644 index d286226bf3a..00000000000 --- a/addons/crm_caldav/test/test_crm_caldav.yml +++ /dev/null @@ -1,37 +0,0 @@ -- | - I create test cases for Sharing meeting with other calendar clients like sunbird. -- | - I start by creating a new Meeting. -- - !record {model: crm.meeting, id: crm_meeting_regardingsharing0}: - categ_id: crm.categ_meet2 - date: !eval time.strftime('%Y-%m-%d 16:04:00') - date_deadline: !eval "(datetime.now() + timedelta(1)).strftime('%Y-%m-%d 00:04:00')" - duration: 8.0 - email_from: info@balmerinc.be - location: Gandhinagar - name: Regarding Sharing with other client - partner_address_id: base.res_partner_address_1 - partner_id: base.res_partner_9 - rrule_type: weekly - section_id: crm.section_sales_department - -- - I check the export functionality. -- - !python {model: crm.meeting}: | - self.export_cal(cr, uid, [ref('crm_meeting_regardingsharing0')], context) - import time - vals = [] - context.update({'model':'crm.meeting','active_id': ref('crm_meeting_regardingsharing0')}) - vals.append({ - 'date': time.strftime('%Y-%m-%d 16:04:00'), - 'create_date': time.strftime('%Y-%m-%d 16:04:00'), - 'date_deadline':time.strftime('%Y-%m-%d 20:20:00'), - 'id':ref('crm_meeting_regardingsharing0'), - 'recurrent_id': time.strftime('%Y-%m-%d 50:00:00'), - }) - try: - self.check_import(cr, uid, vals, context) - except: - pass diff --git a/addons/crm_helpdesk/test/test_crm_helpdesk.yml b/addons/crm_helpdesk/test/test_crm_helpdesk.yml index 1dab04ee49c..eb0a25d2110 100644 --- a/addons/crm_helpdesk/test/test_crm_helpdesk.yml +++ b/addons/crm_helpdesk/test/test_crm_helpdesk.yml @@ -28,7 +28,7 @@ !assert {model: crm.helpdesk, id: crm_helpdesk_somefunctionalquestion0}: - state == 'draft' - | - In order to make this helpdesk request to be considered I make it "Open". + I make it "Open". - !python {model: crm.helpdesk}: | self.case_open(cr, uid, [ref('crm_helpdesk_somefunctionalquestion0')]) From f7fde320770f6d338e459c9e79478198681ba075 Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Fri, 23 Sep 2011 11:07:22 +0530 Subject: [PATCH 24/26] [IMP]Improve the statments of yml file bzr revid: dbr@tinyerp.com-20110923053722-2o05hvar14yoavp2 --- addons/crm/test/test_crm_lead_case2.yml | 36 ++++++++++++------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/addons/crm/test/test_crm_lead_case2.yml b/addons/crm/test/test_crm_lead_case2.yml index c8712d861d4..23a654d31a8 100644 --- a/addons/crm/test/test_crm_lead_case2.yml +++ b/addons/crm/test/test_crm_lead_case2.yml @@ -2,13 +2,13 @@ In order to do complete test the CRM in OpenERP, I will create new full configured record and carry test on it. - | - I Start by creating "Demo Sales Team" with No Unlink. + I Start by creating "Test Sales Team" with No Unlink. I create a crm.case.section record. - !record {model: crm.case.section, id: crm_case_section_demosalesteam}: code: DEMO - complete_name: Demo Sales Team - name: Demo Sales Team + complete_name: Test Sales Team + name: Test Sales Team allow_unlink: False member_ids: - base.user_admin @@ -28,12 +28,12 @@ !record {model: res.users, id: res_users_usercrm0}: context_section_id: crm_case_section_demosalesteam - | - I create a new lead "Demo Customer" and I provide an address to this - demo customer and email "info@democustomer.com" and Also "Demo Sales Team". + I create a new lead "Test Customer" and I provide an address to this + demo customer and email "info@democustomer.com" and Also "Test Sales Team". - !record {model: crm.lead, id: crm_lead_democustomer}: email_from: info@democustomer.com - name: Demo Customer + name: Test Customer partner_name: NotSoTinySARL phone: (+32).81.81.37.00 mobile: (+32).81.81.37.00 @@ -52,19 +52,19 @@ name: crm_case_section_demosalesteam section_id: crm_case_section_demosalesteam - - I assigning contact detail to the Lead "Demo Customer" without address. + I assigning contact detail to the Lead "Test Customer" without address. - !python {model: crm.lead}: | self.onchange_partner_address_id(cr, uid, ref("crm_lead_democustomer"), None, email=False) - - I assigning contact detail to the Lead "Demo Customer" with address. + I assigning contact detail to the Lead "Test Customer" with address. - !python {model: crm.lead}: | self.onchange_partner_address_id(cr, uid, ref("crm_lead_democustomer"), ref("base.res_partner_address_notsotinysarl0"), email=False) - - I selecting email "Opt-out" option for the "Demo Customer" Lead. + I selecting email "Opt-out" option for the "Test Customer" Lead. - !python {model: crm.lead}: | self.on_change_optout(cr, uid, ref("crm_lead_democustomer"), True) @@ -80,12 +80,12 @@ !python {model: crm.lead}: | self.case_open(cr, uid, [ref("crm_lead_democustomer")]) - - I check that lead "Demo Customer" is now in 'open' state. + I check that lead "Test Customer" is now in 'open' state. - !assert {model: crm.lead, id: crm_lead_democustomer, string: Lead in open state}: - state == "open" - - I reset the lead "Demo Customer". + I reset the lead "Test Customer". - !python {model: crm.lead}: | self.case_reset(cr, uid, [ref("crm_lead_democustomer")]) @@ -95,12 +95,12 @@ !python {model: crm.lead}: | self.case_open(cr, uid, [ref("crm_lead_democustomer")]) - - I setting stage "New" for the lead "Demo Customer". + I setting stage "New" for the lead "Test Customer". - !python {model: crm.lead}: | self.stage_next(cr, uid, [ref("crm_lead_democustomer")], context={'stage_type': 'lead'}) - - I try to Unlink the Lead "Demo Customer" demo Lead. + I try to Unlink the Lead "Test Customer" demo Lead. - !python {model: crm.lead}: | try: @@ -108,17 +108,17 @@ except: pass - - I setting Lead "Demo Customer" to Pending State. + I setting Lead "Test Customer" to Pending State. - !python {model: crm.lead}: | self.case_pending(cr, uid, [ref("crm_lead_democustomer")]) - - I check that lead "Demo Customer" is now in 'Pending' state. + I check that lead "Test Customer" is now in 'Pending' state. - !assert {model: crm.lead, id: crm_lead_democustomer, string: Lead in Pending state}: - state == "pending" - - I Escalate the Lead "Demo Customer" Parent "Sales Team". + I Escalate the Lead "Test Customer" Parent "Sales Team". - !python {model: crm.lead}: | self.case_escalate(cr, uid, [ref("crm_lead_democustomer")]) @@ -138,7 +138,7 @@ self.action_add(cr, uid, [ref("crm_add_note_0")], context=context) - - I Copying this lead "Demo Customer" to New Lead. + I Copying this lead "Test Customer" to New Lead. - !python {model: crm.lead}: | self.copy(cr, uid, ref("crm_lead_democustomer")) @@ -146,6 +146,6 @@ I checking the Lead Copied or Not. - !python {model: crm.lead}: | - sid = self.search(cr, uid, [('name', '=', 'Demo Customer'),('state', '=', 'draft')]) + sid = self.search(cr, uid, [('name', '=', 'Test Customer'),('state', '=', 'draft')]) if not sid: raise AssertionError("Lead is not copied Successfully") From a198350e582750f4e8c4bfc987ff8d8942aa549f Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Fri, 23 Sep 2011 12:09:49 +0530 Subject: [PATCH 25/26] [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')]) From 3139b3cfafe954f68dede0bd7dd87b58aa2885c4 Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Fri, 23 Sep 2011 12:19:08 +0530 Subject: [PATCH 26/26] Statements changes bzr revid: dbr@tinyerp.com-20110923064908-cjg4owqe8y49ff9j --- addons/crm/test/test_crm_lead.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/crm/test/test_crm_lead.yml b/addons/crm/test/test_crm_lead.yml index 830a21ca807..6a954939e04 100644 --- a/addons/crm/test/test_crm_lead.yml +++ b/addons/crm/test/test_crm_lead.yml @@ -76,37 +76,37 @@ assert action['res_model'] == 'crm.lead2opportunity.partner' - | - I select "create a new partner" option in this wizard. + I select "create a new partner" option. - !record {model: crm.lead2opportunity.partner, id: crm_lead2opportunity_partner_create_0}: action: 'create' name: 'convert' - - Then, Click on "Create Opportunity" button of this wizard. + Then, Click on "Create Opportunity" button. - !python {model: crm.lead2opportunity.partner}: | self.action_apply(cr, uid, [ref("crm_lead2opportunity_partner_create_0")], {'active_ids': [ref("crm_lead_newcustomer0")], 'active_id': ref("crm_lead_newcustomer0")}) - | - I select "Link to an existing partner" option in this wizard. + I select "Link to an existing partner" option. - !record {model: crm.lead2opportunity.partner, id: crm_lead2opportunity_partner_create_1}: action: 'exist' name: 'existing partner' - - Then, Click on "Create Opportunity" button of this wizard. + Then, Click on "Create Opportunity" button. - !python {model: crm.lead2opportunity.partner}: | self.action_apply(cr, uid, [ref("crm_lead2opportunity_partner_create_1")], {'active_ids': [ref("crm_lead_newcustomer0")], 'active_id': ref("crm_lead_newcustomer0")}) - | - I select "Do not link to a partner" option in this wizard. + I select "Do not link to a partner" option. - !record {model: crm.lead2opportunity.partner, id: crm_lead2opportunity_partner_create_2}: action: 'nothing' name: 'Do not link to a partner' - - Then, Click on "Create Opportunity" button of this wizard. + Then, Click on "Create Opportunity" button. - !python {model: crm.lead2opportunity.partner}: | self.action_apply(cr, uid, [ref("crm_lead2opportunity_partner_create_2")], {'active_ids': [ref("crm_lead_newcustomer0")], 'active_id': ref("crm_lead_newcustomer0")})