From 3d82d827c854b63316fa1fba29187921c24f38d8 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Mon, 10 Oct 2011 18:56:22 +0530 Subject: [PATCH 001/132] [ADD, REF]: CRM: 1)Created new process folder and moved test_crm_lead.yml to process_crm_lead.yml, 2)Removed unused created user for crm (process_crm_lead.yml), 3)Changed Lead name New Customer to proper name, 4)Removed Cancle operation from process_crm_lead.yml bzr revid: ron@tinyerp.com-20111010132622-329w2fv0jbt0rc7y --- addons/crm/__openerp__.py | 3 +- .../process_crm_lead.yml} | 32 ++----------------- 2 files changed, 4 insertions(+), 31 deletions(-) rename addons/crm/test/{test_crm_lead.yml => process/process_crm_lead.yml} (81%) diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index a6f5f1630f7..27beb8e58ee 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -119,7 +119,8 @@ Creates a dashboard for CRM that includes: 'crm_phonecall_demo.xml', ], 'test': [ - 'test/test_crm_lead.yml', + 'test/process/process_crm_lead.yml', + 'test/process/cancle_crm_lead.yml', 'test/test_crm_meeting.yml', 'test/test_crm_opportunity.yml', 'test/test_crm_phonecall.yml', diff --git a/addons/crm/test/test_crm_lead.yml b/addons/crm/test/process/process_crm_lead.yml similarity index 81% rename from addons/crm/test/test_crm_lead.yml rename to addons/crm/test/process/process_crm_lead.yml index d5d3c6b933b..f35b03dcd4f 100644 --- a/addons/crm/test/test_crm_lead.yml +++ b/addons/crm/test/process/process_crm_lead.yml @@ -1,27 +1,10 @@ -- - 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 business opportunity and a partner. -- - I create a two new users "user_crm" and I assign the group "salesman". -- - !record {model: res.users, id: res_users_usercrm0}: - company_id: base.main_company - context_lang: en_US - context_section_id: crm.section_sales_department - groups_id: - - base.group_sale_salesman - login: user_crm - name: user_crm - password: user_crm - - | - I start by creating a new lead "New Customer" and I provide an address to this + I start by creating a new lead "Steave Jon" and I provide an address to this new customer, as well as an email "info@mycustomer.com". - !record {model: crm.lead, id: crm_lead_newcustomer0}: email_from: info@mycustomer.com - name: New Customer + name: Steave Jon partner_name: Capegemini partner_id: base.res_partner_9 phone: (855) 924-4364 @@ -125,17 +108,6 @@ - !assert {model: crm.lead, id: crm_lead_newcustomer0, string: Lead in done state}: - state == "done" -- - I 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. From d202549512dea80767b844e2a7a732e58e1f29bc Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Tue, 11 Oct 2011 12:25:03 +0530 Subject: [PATCH 002/132] [ADD]: crm: 1) Add new yml on process folder cancle_crm_lead.yml 2) Checked for lead from any stage, It will be cancle or not 3) If Lead not handle by executive team so its need to Escalate lead from sales executive department to sales department and checked that 4) Checked for lead cancle from Escalate stage bzr revid: ron@tinyerp.com-20111011065503-x1o4pbhtkyaznuyp --- addons/crm/test/process/cancle_crm_lead.yml | 48 +++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 addons/crm/test/process/cancle_crm_lead.yml diff --git a/addons/crm/test/process/cancle_crm_lead.yml b/addons/crm/test/process/cancle_crm_lead.yml new file mode 100644 index 00000000000..c8d02c6414c --- /dev/null +++ b/addons/crm/test/process/cancle_crm_lead.yml @@ -0,0 +1,48 @@ +- + Cheking for lead from any stage, It will be cancle or not. +- + !python {model: crm.lead}: | + lead_on_draft=self.browse(cr, uid, ref("crm_case_itisatelesalescampaign0")) + assert lead_on_draft.state == 'draft', "Lead is not in draft state" + self.case_cancel(cr, uid, [ref("crm_case_itisatelesalescampaign0")]) + lead_on_cancel=self.browse(cr, uid, ref("crm_case_itisatelesalescampaign0")) + assert lead_on_cancel.state == 'cancel', "Lead is not in cancel state" + self.case_reset(cr, uid, [ref("crm_case_itisatelesalescampaign0")]) + lead_on_reset=self.browse(cr, uid, ref("crm_case_itisatelesalescampaign0")) + assert lead_on_reset.state == 'draft', "Lead is not in draft state" + self.case_pending(cr, uid, [ref("crm_case_itisatelesalescampaign0")]) + lead_on_pending=self.browse(cr, uid, ref("crm_case_itisatelesalescampaign0")) + assert lead_on_pending.state == 'pending', "Lead is not in pending state" + self.case_cancel(cr, uid, [ref("crm_case_itisatelesalescampaign0")]) + lead_pending_cancel=self.browse(cr, uid, ref("crm_case_itisatelesalescampaign0")) + assert lead_pending_cancel.state == 'cancel', "Lead is not in cancel state" + +- + For working on parent child relationship, we are creating sales executive department that will be work under + Sales Department. +- + !record {model: crm.case.section, id: section_sales_exe_department}: + name: "Sales Executive" + parent_id: crm.section_sales_department + +- + If Lead not handle by executive team so its need to Escalate lead from sales executive department to sales department, + for that purpose i Assign sales executive department on lead, after we will be process to escalate lead to sales department +- + !record {model: crm.lead, id: crm.crm_case_itisatelesalescampaign0}: + section_id: section_sales_exe_department +- + Processing on Lead escalate to sales Departemnt, we are checking for lead Escalate to sales Department from Executive + department or not. +- + !python {model: crm.lead}: | + lead_rec=self.browse(cr, uid, ref("crm_case_itisatelesalescampaign0")) + self.case_reset(cr, uid, [ref("crm_case_itisatelesalescampaign0")]) + lead_cancle_reset=self.browse(cr, uid, ref("crm_case_itisatelesalescampaign0")) + assert lead_cancle_reset.state == 'draft', "Lead is not in draft state" + self.case_escalate(cr, uid, [ref("crm_case_itisatelesalescampaign0")]) + lead_on_escalate=self.browse(cr, uid, ref("crm_case_itisatelesalescampaign0")) + assert lead_on_escalate.section_id.name == 'Sales Department', "Do not Escalate lead to on sales team from Executive team" + self.case_cancel(cr, uid, [ref("crm_case_itisatelesalescampaign0")]) + lead_escalate_cancel=self.browse(cr, uid, ref("crm_case_itisatelesalescampaign0")) + assert lead_escalate_cancel.state == 'cancel', "Lead is not in cancel state" From 618fc88e3336276cef93502677bbf465c67f3444 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Tue, 11 Oct 2011 15:36:49 +0530 Subject: [PATCH 003/132] [ADD, REF]: crm: 1) Moved test_crm_meeting.yml to process/process_crm_meeting.yml 2) Used demo data from xml file instead of created yml data, 3) Improved all string regarding to end user and remove all string like coder, 4) Added confirm state and done state of meeting and cheked its worked or not bzr revid: ron@tinyerp.com-20111011100649-wmokfc1tiknua2zz --- addons/crm/__openerp__.py | 2 +- .../crm/test/process/process_crm_meeting.yml | 72 ++++++++++++++ addons/crm/test/test_crm_meeting.yml | 97 ------------------- 3 files changed, 73 insertions(+), 98 deletions(-) create mode 100644 addons/crm/test/process/process_crm_meeting.yml delete mode 100644 addons/crm/test/test_crm_meeting.yml diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index 27beb8e58ee..36e8fdb4d1e 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -121,7 +121,7 @@ Creates a dashboard for CRM that includes: 'test': [ 'test/process/process_crm_lead.yml', 'test/process/cancle_crm_lead.yml', - 'test/test_crm_meeting.yml', + 'test/process/process_crm_meeting.yml', 'test/test_crm_opportunity.yml', 'test/test_crm_phonecall.yml', 'test/test_crm_recurrent_meeting.yml', diff --git a/addons/crm/test/process/process_crm_meeting.yml b/addons/crm/test/process/process_crm_meeting.yml new file mode 100644 index 00000000000..91535424964 --- /dev/null +++ b/addons/crm/test/process/process_crm_meeting.yml @@ -0,0 +1,72 @@ +- | + Customer want to do initial discussion with us so we will arrage meeting or + phonecalles or internal Meeting with them. +- + !assert {model: crm.meeting, id: crm.crm_case_initialdiscussion0}: + - state == "draft" +- | + For Remember purpose for meeting, i put reminder "30 minutes before" and assign + to meeting. +- + !python {model: crm.meeting}: | + self.write(cr, uid, [ref('crm_case_initialdiscussion0')], {'alarm_id': ref("base_calendar.alarm5")}) +- | + 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 to Friday 10 times. +- + !python {model: crm.meeting}: | + self.write(cr, uid, [ref("crm_case_initialdiscussion0")], {'fr': 1, 'mo': 1, 'th': 1, 'tu': 1, 'we':1, 'count':10, 'interval': 1, 'rrule_type': 'weekly'}) + +- | + The meeting is scheduled on Monday and Friday for 10 times so i can see from the calendar view +- + !python {model: crm.meeting}: | + self.fields_view_get(cr, uid, False, 'calendar', context) +- | + We can check 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', '=', 'Initial discussion')], context={'virtual_id': True}) + assert len(ids) == 10 + +- | + 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_case_initialdiscussion0')], {'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. +- + !record {model: crm.meeting, id: crm.crm_case_initialdiscussion0}: + alarm_id: base_calendar.alarm9 + rrule_type: weekly +- | + In order to invite people(internal user) for this meetings, Create record for + people will come on meeting. +- + !record {model: base_calendar.invite.attendee, id: base_calendar_invite_attendee_0}: + type: internal + send_mail: False + partner_id: base.res_partner_9 + user_ids: + - base.user_demo +- + Now inviting those people which we are registers. +- + !python {model: base_calendar.invite.attendee}: | + self.do_invite(cr, uid, [ref('base_calendar_invite_attendee_0')], {'active_id': ref('crm_case_initialdiscussion0'), 'model' : 'crm.meeting', 'attendee_field':'attendee_ids'}) +- | + All conformation is completed for meeting now going to confirm meeting + and we can check also after completion of meeting, it is done or not. +- + !python {model: crm.meeting}: | + self.case_open(cr, uid, [ref('crm_case_initialdiscussion0')]) + meeting_rec = self.browse(cr, uid, ref("crm_case_initialdiscussion0")) + assert meeting_rec.state == 'open', "Meeting is not in confirm state" + self.case_close(cr, uid, [ref('crm_case_initialdiscussion0')]) + meeting_rec_close = self.browse(cr, uid, ref("crm_case_initialdiscussion0")) + assert meeting_rec_close.state == 'done', "Meeting is not in done state" diff --git a/addons/crm/test/test_crm_meeting.yml b/addons/crm/test/test_crm_meeting.yml deleted file mode 100644 index 8d851dd58c7..00000000000 --- a/addons/crm/test/test_crm_meeting.yml +++ /dev/null @@ -1,97 +0,0 @@ -- | - I will test Meetings which may be customer meeting or phonecall meeting or - internal 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') - date_deadline: !eval "(datetime.now() + timedelta(1)).strftime('%Y-%m-%d 00:04:00')" - duration: 8.0 - email_from: info@balmerinc.be - location: Ahmedabad - name: Regarding Presentation - 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 that the Meetings is in 'UnConfirmed' state. -- - !assert {model: crm.meeting, id: crm_meeting_regardingpresentation0}: - - state == "draft" -- | - 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 - trigger_interval: minutes - trigger_occurs: before - trigger_related: start -- | - 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. -- - !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. - -- - !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 - -- | - 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. -- - !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. -- - !record {model: base_calendar.invite.attendee, id: base_calendar_invite_attendee_0}: - type: internal - send_mail: False - partner_id: base.res_partner_9 - user_ids: - - base.user_demo -- - 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'}) - -- | - After direct/indirect confirmation for meetings I can confirm meeting. -- - !python {model: crm.meeting}: | - self.case_open(cr, uid, [ref('crm_meeting_regardingpresentation0')]) From 7316a069b348634586c1f0f3864a60c98a3388f9 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Tue, 11 Oct 2011 15:42:57 +0530 Subject: [PATCH 004/132] [IMP] crm : user not assign properly on test_crm_lead_case2.yml bzr revid: ron@tinyerp.com-20111011101257-p8fiuov1xtjcfvdh --- addons/crm/test/test_crm_lead_case2.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/crm/test/test_crm_lead_case2.yml b/addons/crm/test/test_crm_lead_case2.yml index 23a654d31a8..af1b7e7e07b 100644 --- a/addons/crm/test/test_crm_lead_case2.yml +++ b/addons/crm/test/test_crm_lead_case2.yml @@ -25,7 +25,7 @@ - I assign segmentation. - - !record {model: res.users, id: res_users_usercrm0}: + !record {model: res.users, id: base.user_root}: context_section_id: crm_case_section_demosalesteam - | I create a new lead "Test Customer" and I provide an address to this From da3aca4263643ca170dd395b81827a2e96dd4fd3 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Tue, 11 Oct 2011 18:30:50 +0530 Subject: [PATCH 005/132] [ADD, REF]: crm: 1) Moved test_crm_phonecall.yml to process/process_crm_phonecall.yml 2) Removed Phonecall by log seduling, 3) Improved varibles names and conversion, 4) changed string Interview call to interest with openerp, 5) Improved all string regarding to end user and remove all string like coder, 6) Added stage after completion of phonecall and cheked that working properly or not bzr revid: ron@tinyerp.com-20111011130050-vk24chpik6y4ijc4 --- addons/crm/__openerp__.py | 2 +- .../test/process/process_crm_phonecall.yml | 73 +++++++++++ addons/crm/test/test_crm_phonecall.yml | 116 ------------------ 3 files changed, 74 insertions(+), 117 deletions(-) create mode 100644 addons/crm/test/process/process_crm_phonecall.yml delete mode 100644 addons/crm/test/test_crm_phonecall.yml diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index 36e8fdb4d1e..05ed350bea1 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -123,7 +123,7 @@ Creates a dashboard for CRM that includes: 'test/process/cancle_crm_lead.yml', 'test/process/process_crm_meeting.yml', 'test/test_crm_opportunity.yml', - 'test/test_crm_phonecall.yml', + 'test/process/process_crm_phonecall.yml', 'test/test_crm_recurrent_meeting.yml', 'test/test_crm_stage_changes.yml', 'test/test_crm_recurrent_meeting_case2.yml', diff --git a/addons/crm/test/process/process_crm_phonecall.yml b/addons/crm/test/process/process_crm_phonecall.yml new file mode 100644 index 00000000000..25f3069fac6 --- /dev/null +++ b/addons/crm/test/process/process_crm_phonecall.yml @@ -0,0 +1,73 @@ +- | + For customer or partner purpose, I called to him/her for discussion about openerp. +- + !record {model: crm.phonecall, id: crm_phonecall_disc_openerp}: + date: !eval time.strftime('%Y-%m-%d 08:00:00') + name: Discussion About Openerp + duration: 2.0 + section_id: crm.section_sales_department +- + After called to Customer/partner, So creating record to merge with exiting partner +- + !record {model: crm.phonecall2partner, id: crm_phonecall2partner_existed}: + action: exist + partner_id: base.res_partner_9 + +- + We are going to create partner. +- + !python {model: crm.phonecall2partner}: | + + self._select_partner(cr, uid,{"active_ids": [ref("crm_phonecall_disc_openerp")]}) + self.open_create_partner(cr, uid, [ref("crm_phonecall2partner_existed")], {"active_ids": [ref("crm_phonecall_disc_openerp")]}) + self.make_partner(cr, uid, [ref("crm_phonecall2partner_existed")], {"active_ids": [ref("crm_phonecall_disc_openerp")]}) + +- | + As the success of phonecall seems to be a real business opportunity, It will convert + it to opportunity. +- + !record {model: crm.phonecall2opportunity, id: crm_phonecall2opportunity_disc_openerp}: + name: Discussion About Openerp + partner_id: base.res_partner_9 + planned_revenue: 0.0 + probability: 0.0 +- | + Business opportunity is now assigned to this phonecall. +- + !assert {model: crm.phonecall, id: crm_phonecall_disc_openerp}: + - opportunity_id != False +- + Succeed phonecall, it will be convert into on opportunity. +- + !python {model: crm.phonecall2opportunity}: | + self.action_apply(cr, uid, [ref("crm_phonecall2opportunity_disc_openerp")], {"active_id": ref("crm_phonecall_disc_openerp")}) +- | + For business And I check that the phonecall and the newly created business + opportunity is linked to same partner. +- + !python {model: crm.phonecall}: | + obj_phonecall = self.browse(cr, uid, ref('crm_phonecall_disc_openerp')) + ids = self.pool.get('crm.lead').search(cr, uid, [('name', '=', obj_phonecall.opportunity_id.name)]) + obj_opp = self.pool.get('crm.lead').browse(cr, uid, ids)[0] + assert obj_phonecall.partner_id == obj_opp.partner_id +- | + Customer/partner intested with our product, so we will call back to him/her +- + !record {model: crm.phonecall2phonecall, id: crm_phonecall2phonecall_disc_openerp}: + date: !eval "'%s-%s-%s 19:49:00' %(datetime.now().year,datetime.now().month,datetime.now().day)" + name: interest with openerp + section_id: crm.section_sales_department + user_id: base.user_root + action: schedule + categ_id: crm.categ_phone1 +- | + Create other sedular call which is interested customer/partner. +- + !python {model: crm.phonecall2phonecall}: | + self.action_apply(cr, uid, [ref('crm_phonecall2phonecall_disc_openerp')], {'active_id': ref('crm_phonecall_disc_openerp')}) +- | + Completion of phonecall, Cheking for phonecall summary is close or not. +- + !python {model: crm.phonecall}: | + phonecall_rec = self.browse(cr, uid, ref('crm_phonecall_disc_openerp')) + assert phonecall_rec.state == 'done', "Phonecall is not in done state" diff --git a/addons/crm/test/test_crm_phonecall.yml b/addons/crm/test/test_crm_phonecall.yml deleted file mode 100644 index 0754a5b9544..00000000000 --- a/addons/crm/test/test_crm_phonecall.yml +++ /dev/null @@ -1,116 +0,0 @@ -- | - I start by creating a new phonecall. -- - !record {model: crm.phonecall, id: crm_phonecall_interviewcall0}: - date: !eval time.strftime('%Y-%m-%d 08:00:00') - name: Interview call - duration: 2.0 - section_id: crm.section_sales_department -- - 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 - -- - I click on "Continue" button of this wizard and make partner. -- - !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")]}) - -- | - As the success of phonecall seems to be a real business opportunity, I will convert - it to opportunity by clicking on the "Convert to Opportunity" button. -- - !record {model: crm.phonecall2opportunity, id: crm_phonecall2opportunity_interviewcall0}: - name: Interview call - partner_id: base.res_partner_9 - planned_revenue: 0.0 - probability: 0.0 -- | - 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. -- - !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)]) - 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". -- - !python {model: crm.phonecall}: | - self.action_make_meeting(cr, uid, [ref('crm_phonecall_interviewcall0')]) - -- | - 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. -- - !record {model: crm.meeting, id: crm_meeting_interviewcall0}: - alarm_id: base_calendar.alarm3 - date: !eval "'%s-%s-%s 09:00:00' %(datetime.now().year,datetime.now().month,datetime.now().day)" - date_deadline: !eval "'%s-%s-%s 17:00:00' %(datetime.now().year,datetime.now().month,datetime.now().day)" - duration: 8.0 - email_from: info@balmerinc.be - name: Interview call - partner_address_id: base.res_partner_address_1 - partner_id: base.res_partner_9 - phonecall_id: 'crm_phonecall_interviewcall0' - state: open - -- | - In order to schedule other phonecall to the partner - I click on "schedule other call" button. and plan for other call - I can see that it will open other phonecall view with some data same as current - phonecall. -- - !record {model: crm.phonecall2phonecall, id: crm_phonecall2phonecall_interviewcall0}: - 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: 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')}) From e85f8215237e5feb62311d70c2ed53b53f763a0b Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Tue, 11 Oct 2011 18:34:48 +0530 Subject: [PATCH 006/132] [IMP] crm: String improvement in process_crm_meeting.yml bzr revid: ron@tinyerp.com-20111011130448-vtijq1p0s83o3e4y --- addons/crm/test/process/process_crm_meeting.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/crm/test/process/process_crm_meeting.yml b/addons/crm/test/process/process_crm_meeting.yml index 91535424964..8f8ae2cd417 100644 --- a/addons/crm/test/process/process_crm_meeting.yml +++ b/addons/crm/test/process/process_crm_meeting.yml @@ -55,7 +55,7 @@ user_ids: - base.user_demo - - Now inviting those people which we are registers. + Now inviting those people which we are registered. - !python {model: base_calendar.invite.attendee}: | self.do_invite(cr, uid, [ref('base_calendar_invite_attendee_0')], {'active_id': ref('crm_case_initialdiscussion0'), 'model' : 'crm.meeting', 'attendee_field':'attendee_ids'}) From cce4c999e1f0095cc6a20023a156341c548b0f59 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Wed, 12 Oct 2011 11:06:14 +0530 Subject: [PATCH 007/132] [IMP, REF]: crm: All Changes on process_crm_lead.yml, 1) Used demo data instead of yml creation data of lead, 2) Improved variables names and conversion, 3) Improved all string regarding to end user and remove all string like coder, 4) Removed mass wizard to convert lead to opportunity bzr revid: ron@tinyerp.com-20111012053614-4fddssqes817phtg --- addons/crm/test/process/process_crm_lead.yml | 100 +++++++------------ 1 file changed, 34 insertions(+), 66 deletions(-) diff --git a/addons/crm/test/process/process_crm_lead.yml b/addons/crm/test/process/process_crm_lead.yml index f35b03dcd4f..db1ffa4e753 100644 --- a/addons/crm/test/process/process_crm_lead.yml +++ b/addons/crm/test/process/process_crm_lead.yml @@ -1,112 +1,80 @@ -- | - I start by creating a new lead "Steave Jon" and I provide an address to this - new customer, as well as an email "info@mycustomer.com". - - !record {model: crm.lead, id: crm_lead_newcustomer0}: - email_from: info@mycustomer.com - name: Steave Jon - partner_name: Capegemini - partner_id: base.res_partner_9 - phone: (855) 924-4364 - mobile: (333) 715-1450 - section_id: crm.section_sales_department - referred: False -- | - I check that the lead is in 'draft' state. + Communication by phonecall or mail I got lead from Customer/partner, I test to created lead in initial stage. - - !assert {model: crm.lead, id: crm_lead_newcustomer0, string: Lead in Draft}: + !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: Lead in Draft}: - state == "draft" - - I open lead by click on "Open" button. + After some discussion about lead with customer/partner some possibillity to go ahead, so we are opening this lead. - !python {model: crm.lead}: | - self.case_open(cr, uid, [ref("crm_lead_newcustomer0")]) + self.case_open(cr, uid, [ref("crm_case_qrecorp0")]) fields={ 'day_open': 0.0, 'day_close': 0.0 } - self._compute_day(cr, uid, [ref("crm_lead_newcustomer0")], fields, context) + self._compute_day(cr, uid, [ref("crm_case_qrecorp0")], fields, context) - | - I check that lead is now in 'open' state. + In order to test lead, i will test lead is in open stage. - - !assert {model: crm.lead, id: crm_lead_newcustomer0, string: Lead in open state}: + !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: Lead in open state}: - state == "open" - - I search 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 - and a business opportunity by clicking on the "Convert" button. + As the lead seems to be a real business opportunity, I will convert it to a partner + and a business opportunity. - !python {model: crm.lead}: | - lead = self.browse(cr, uid, ref('crm_lead_newcustomer0')) - action = self.convert_opportunity(cr, uid, [ref("crm_lead_newcustomer0")], {'active_ids': [ref("crm_lead_newcustomer0")]}) + lead = self.browse(cr, uid, ref('crm_case_qrecorp0')) + action = self.convert_opportunity(cr, uid, [ref("crm_case_qrecorp0")], {'active_ids': [ref("crm_case_qrecorp0")]}) assert action['res_model'] == 'crm.lead2opportunity.partner' - - | - I select "create a new partner" option. + In order to create partner, It is possible to check for partner is exiting or i will create new partner + according to this lead. so first i will create new partner. - !record {model: crm.lead2opportunity.partner, id: crm_lead2opportunity_partner_create_0}: action: 'create' name: 'convert' - - Then, Click on "Create Opportunity" button. + In order to create opportunity and its created by new partner. - !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")}) + self.action_apply(cr, uid, [ref("crm_lead2opportunity_partner_create_0")], {'active_ids': [ref("crm_case_qrecorp0")], 'active_id': ref("crm_case_qrecorp0")}) - - | - I select "Link to an existing partner" option. + In order to test with exiting partner, so i will test with exiting partner and create opportunities based + on exiting partner. - !record {model: crm.lead2opportunity.partner, id: crm_lead2opportunity_partner_create_1}: action: 'exist' - - Then, Click on "Create Opportunity" button. + Create opportunity based on exiting partner - !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")}) + self.action_apply(cr, uid, [ref("crm_lead2opportunity_partner_create_1")], {'active_ids': [ref("crm_case_qrecorp0")], 'active_id': ref("crm_case_qrecorp0")}) - - | - I select "Do not link to a partner" option. + In order to test with no link wih partner, so i will test create opportunities based + no link to any partner. - - !record {model: crm.lead2opportunity.partner, id: crm_lead2opportunity_partner_create_2}: - action: 'nothing' + !record {model: crm.lead2opportunity.partner, id: crm_lead2opportunity_partner_create_2}: + action: 'nothing' - - Then, Click on "Create Opportunity" button. + In order to test create opportunity based on no link to any partner. - - !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. + !python {model: crm.lead2opportunity.partner}: | + self.action_apply(cr, uid, [ref("crm_lead2opportunity_partner_create_2")], {'active_ids': [ref("crm_case_qrecorp0")], 'active_id': ref("crm_case_qrecorp0")}) +- + In order to test lead, i will test to lead is converted to opportunity. - !python {model: crm.lead}: | - lead = self.browse(cr, uid, ref("crm_lead_newcustomer0")) + lead = self.browse(cr, uid, ref("crm_case_qrecorp0")) assert lead.type == 'opportunity' - - - I create mass report of lead to opprtunity partner. + Finally, i won this lead and congratulation we have new partner so i will close this lead. - - !record {model: crm.lead2opportunity.partner.mass, id: crm_lead2opportunity_partner_mass0}: - user_ids: - - base.user_root - section_id: crm.section_sales_department + !python {model: crm.lead}: | + self.case_close(cr, uid, [ref("crm_case_qrecorp0")]) - - Then, execute that mass wizard. + In order to test lead, i will test its on close or not. - - !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 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}: + !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: Lead in done state}: - state == "done" #- # | From 7e237da6090533e7ea2f374719abef1592986eee Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Wed, 12 Oct 2011 12:00:36 +0530 Subject: [PATCH 008/132] [IMP] crm: Error generated by assigned wrong reference on test_crm_opportunity.yml bzr revid: ron@tinyerp.com-20111012063036-hlm825p2gut48o29 --- addons/crm/test/test_crm_opportunity.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/crm/test/test_crm_opportunity.yml b/addons/crm/test/test_crm_opportunity.yml index 734a1cae46c..8f171311b4d 100644 --- a/addons/crm/test/test_crm_opportunity.yml +++ b/addons/crm/test/test_crm_opportunity.yml @@ -109,5 +109,5 @@ !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')] + lead_ids = [ref('crm_case_qrecorp0')] self.merge(cr, uid, op_ids, {'lead_ids': lead_ids}) From ac090c0b3ec42a5d458a7564338694166a717588 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Wed, 12 Oct 2011 14:45:33 +0530 Subject: [PATCH 009/132] [REF] crm: 1) rename file process_crm_lead.yml to crm_lead_open.yml and its have checked till qualified lead bzr revid: ron@tinyerp.com-20111012091533-bwxqz7t6f5dsni1s --- addons/crm/test/process/crm_lead_open.yml | 10 +++ addons/crm/test/process/process_crm_lead.yml | 94 -------------------- 2 files changed, 10 insertions(+), 94 deletions(-) create mode 100644 addons/crm/test/process/crm_lead_open.yml delete mode 100644 addons/crm/test/process/process_crm_lead.yml diff --git a/addons/crm/test/process/crm_lead_open.yml b/addons/crm/test/process/crm_lead_open.yml new file mode 100644 index 00000000000..d5c6bb2d101 --- /dev/null +++ b/addons/crm/test/process/crm_lead_open.yml @@ -0,0 +1,10 @@ +- + Communication by phonecall or mail I got lead from Customer/partner, I test to created lead in initial stage. +- + !python {model: crm.lead}: | + self.case_open(cr, uid, [ref("crm_case_qrecorp0")]) +- | + In order to test lead, i will test lead is in open stage. +- + !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: Lead in open state}: + - state == "open" diff --git a/addons/crm/test/process/process_crm_lead.yml b/addons/crm/test/process/process_crm_lead.yml deleted file mode 100644 index db1ffa4e753..00000000000 --- a/addons/crm/test/process/process_crm_lead.yml +++ /dev/null @@ -1,94 +0,0 @@ -- - Communication by phonecall or mail I got lead from Customer/partner, I test to created lead in initial stage. -- - !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: Lead in Draft}: - - state == "draft" -- - After some discussion about lead with customer/partner some possibillity to go ahead, so we are opening this lead. -- - !python {model: crm.lead}: | - self.case_open(cr, uid, [ref("crm_case_qrecorp0")]) - fields={ - 'day_open': 0.0, - 'day_close': 0.0 - } - self._compute_day(cr, uid, [ref("crm_case_qrecorp0")], fields, context) -- | - In order to test lead, i will test lead is in open stage. -- - !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: Lead in open state}: - - state == "open" -- - As the lead seems to be a real business opportunity, I will convert it to a partner - and a business opportunity. -- - !python {model: crm.lead}: | - lead = self.browse(cr, uid, ref('crm_case_qrecorp0')) - action = self.convert_opportunity(cr, uid, [ref("crm_case_qrecorp0")], {'active_ids': [ref("crm_case_qrecorp0")]}) - assert action['res_model'] == 'crm.lead2opportunity.partner' -- - In order to create partner, It is possible to check for partner is exiting or i will create new partner - according to this lead. so first i will create new partner. -- - !record {model: crm.lead2opportunity.partner, id: crm_lead2opportunity_partner_create_0}: - action: 'create' - name: 'convert' -- - In order to create opportunity and its created by new partner. -- - !python {model: crm.lead2opportunity.partner}: | - self.action_apply(cr, uid, [ref("crm_lead2opportunity_partner_create_0")], {'active_ids': [ref("crm_case_qrecorp0")], 'active_id': ref("crm_case_qrecorp0")}) -- - In order to test with exiting partner, so i will test with exiting partner and create opportunities based - on exiting partner. -- - !record {model: crm.lead2opportunity.partner, id: crm_lead2opportunity_partner_create_1}: - action: 'exist' -- - Create opportunity based on exiting partner -- - !python {model: crm.lead2opportunity.partner}: | - self.action_apply(cr, uid, [ref("crm_lead2opportunity_partner_create_1")], {'active_ids': [ref("crm_case_qrecorp0")], 'active_id': ref("crm_case_qrecorp0")}) -- - In order to test with no link wih partner, so i will test create opportunities based - no link to any partner. -- - !record {model: crm.lead2opportunity.partner, id: crm_lead2opportunity_partner_create_2}: - action: 'nothing' -- - In order to test create opportunity based on no link to any partner. -- - !python {model: crm.lead2opportunity.partner}: | - self.action_apply(cr, uid, [ref("crm_lead2opportunity_partner_create_2")], {'active_ids': [ref("crm_case_qrecorp0")], 'active_id': ref("crm_case_qrecorp0")}) -- - In order to test lead, i will test to lead is converted to opportunity. -- - !python {model: crm.lead}: | - lead = self.browse(cr, uid, ref("crm_case_qrecorp0")) - assert lead.type == 'opportunity' -- - Finally, i won this lead and congratulation we have new partner so i will close this lead. -- - !python {model: crm.lead}: | - self.case_close(cr, uid, [ref("crm_case_qrecorp0")]) -- - In order to test lead, i will test its on close or not. -- - !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: Lead in done state}: - - state == "done" -#- -# | -# yaml is also not working with smtp server and send new email. - -- | - I configure with smtp server. -- | - And I communicate with lead through send New mail to Lead using its email address from the user who is logged in. -- | - I check that communication history generated when send email to lead. -- | - Then, I add a cc which receive copy of future communication between partner and users by mail. - -- | - I Reply to last Email to lead with some document attached.and check that communication history generated or not. - From aef95be470d8b889fb4ede1131f000f30ad31abc Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Wed, 12 Oct 2011 15:31:34 +0530 Subject: [PATCH 010/132] [ADD] crm: 1) Added new crm_lead_to_opportunity.yml bzr revid: ron@tinyerp.com-20111012100134-gueog210ck07yhx6 --- addons/crm/__openerp__.py | 3 +- .../test/process/crm_lead_to_opportunity.yml | 36 +++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 addons/crm/test/process/crm_lead_to_opportunity.yml diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index 05ed350bea1..d7256360d40 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -119,7 +119,8 @@ Creates a dashboard for CRM that includes: 'crm_phonecall_demo.xml', ], 'test': [ - 'test/process/process_crm_lead.yml', + 'test/process/crm_lead_open.yml', + 'test/process/crm_lead_to_opportunity.yml', 'test/process/cancle_crm_lead.yml', 'test/process/process_crm_meeting.yml', 'test/test_crm_opportunity.yml', diff --git a/addons/crm/test/process/crm_lead_to_opportunity.yml b/addons/crm/test/process/crm_lead_to_opportunity.yml new file mode 100644 index 00000000000..2c1ccc65bfb --- /dev/null +++ b/addons/crm/test/process/crm_lead_to_opportunity.yml @@ -0,0 +1,36 @@ +- + As the lead seems to be a real business opportunity, I will convert it to a partner + and a business opportunity. +- + !record {model: crm.lead2opportunity.partner, id: crm_lead2opportunity_partner_create_1}: + action: 'exist' +- + Create opportunity based on exiting partner +- + !python {model: crm.lead2opportunity.partner}: | + self.action_apply(cr, uid, [ref("crm_lead2opportunity_partner_create_1")], {'active_ids': [ref("crm_case_qrecorp0")], 'active_id': ref("crm_case_qrecorp0")}) +- + In order to test lead, i will test to lead is converted to opportunity. +- + !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: Lead is not converted on opportunity}: + - type == 'opportunity' +- + Finally, i won this lead, so i will close this lead. +- + !python {model: crm.lead}: | + self.case_mark_won(cr, uid, [ref("crm_case_qrecorp0")]) +- + In order to test lead, it is close or not. +- + !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: Lead in done state}: + - state == "done" +- + After won this lead probability is 100. +- + !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: Probability is equal to 100}: + - probability == 100.0 +- + In order to test stage of opportunity after win, i will test stage of opportunity. +- + !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: stage of opportunity is win}: + - stage_id.name == "Won" From b864f6dbb749b093d2b2fb4e2b24155518b8082d Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Wed, 12 Oct 2011 16:03:09 +0530 Subject: [PATCH 011/132] [REF] crm: 1) Rename process_crm_meeting.yml to crm_meeting.yml 2) Covered from confirmatation to close meeting bzr revid: ron@tinyerp.com-20111012103309-j71jwxzn52xbsnma --- addons/crm/test/process/crm_meeting.yml | 12 ++++ .../crm/test/process/process_crm_meeting.yml | 72 ------------------- 2 files changed, 12 insertions(+), 72 deletions(-) create mode 100644 addons/crm/test/process/crm_meeting.yml delete mode 100644 addons/crm/test/process/process_crm_meeting.yml diff --git a/addons/crm/test/process/crm_meeting.yml b/addons/crm/test/process/crm_meeting.yml new file mode 100644 index 00000000000..508b1eaff59 --- /dev/null +++ b/addons/crm/test/process/crm_meeting.yml @@ -0,0 +1,12 @@ +- | + Customer want to do initial discussion with us so we will arrage meeting + with them and checked also confirm meeting and after cheked it will be + completed. +- + !python {model: crm.meeting}: | + self.case_open(cr, uid, [ref('crm_case_initialdiscussion0')]) + meeting_rec = self.browse(cr, uid, ref("crm_case_initialdiscussion0")) + assert meeting_rec.state == 'open', "Meeting is not in confirm state" + self.case_close(cr, uid, [ref('crm_case_initialdiscussion0')]) + meeting_rec_close = self.browse(cr, uid, ref("crm_case_initialdiscussion0")) + assert meeting_rec_close.state == 'done', "Meeting is not in done state" \ No newline at end of file diff --git a/addons/crm/test/process/process_crm_meeting.yml b/addons/crm/test/process/process_crm_meeting.yml deleted file mode 100644 index 8f8ae2cd417..00000000000 --- a/addons/crm/test/process/process_crm_meeting.yml +++ /dev/null @@ -1,72 +0,0 @@ -- | - Customer want to do initial discussion with us so we will arrage meeting or - phonecalles or internal Meeting with them. -- - !assert {model: crm.meeting, id: crm.crm_case_initialdiscussion0}: - - state == "draft" -- | - For Remember purpose for meeting, i put reminder "30 minutes before" and assign - to meeting. -- - !python {model: crm.meeting}: | - self.write(cr, uid, [ref('crm_case_initialdiscussion0')], {'alarm_id': ref("base_calendar.alarm5")}) -- | - 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 to Friday 10 times. -- - !python {model: crm.meeting}: | - self.write(cr, uid, [ref("crm_case_initialdiscussion0")], {'fr': 1, 'mo': 1, 'th': 1, 'tu': 1, 'we':1, 'count':10, 'interval': 1, 'rrule_type': 'weekly'}) - -- | - The meeting is scheduled on Monday and Friday for 10 times so i can see from the calendar view -- - !python {model: crm.meeting}: | - self.fields_view_get(cr, uid, False, 'calendar', context) -- | - We can check 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', '=', 'Initial discussion')], context={'virtual_id': True}) - assert len(ids) == 10 - -- | - 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_case_initialdiscussion0')], {'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. -- - !record {model: crm.meeting, id: crm.crm_case_initialdiscussion0}: - alarm_id: base_calendar.alarm9 - rrule_type: weekly -- | - In order to invite people(internal user) for this meetings, Create record for - people will come on meeting. -- - !record {model: base_calendar.invite.attendee, id: base_calendar_invite_attendee_0}: - type: internal - send_mail: False - partner_id: base.res_partner_9 - user_ids: - - base.user_demo -- - Now inviting those people which we are registered. -- - !python {model: base_calendar.invite.attendee}: | - self.do_invite(cr, uid, [ref('base_calendar_invite_attendee_0')], {'active_id': ref('crm_case_initialdiscussion0'), 'model' : 'crm.meeting', 'attendee_field':'attendee_ids'}) -- | - All conformation is completed for meeting now going to confirm meeting - and we can check also after completion of meeting, it is done or not. -- - !python {model: crm.meeting}: | - self.case_open(cr, uid, [ref('crm_case_initialdiscussion0')]) - meeting_rec = self.browse(cr, uid, ref("crm_case_initialdiscussion0")) - assert meeting_rec.state == 'open', "Meeting is not in confirm state" - self.case_close(cr, uid, [ref('crm_case_initialdiscussion0')]) - meeting_rec_close = self.browse(cr, uid, ref("crm_case_initialdiscussion0")) - assert meeting_rec_close.state == 'done', "Meeting is not in done state" From 6b19d9baa1d501d18a4dd1550ff50d88d6354faa Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Wed, 12 Oct 2011 16:22:21 +0530 Subject: [PATCH 012/132] [IMP] crm: 1) Improvement in openerp for correct path of crm_meeting.yml bzr revid: ron@tinyerp.com-20111012105221-mxlfnzeg16s93d7u --- addons/crm/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index d7256360d40..51489fd5aa4 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -122,7 +122,7 @@ Creates a dashboard for CRM that includes: 'test/process/crm_lead_open.yml', 'test/process/crm_lead_to_opportunity.yml', 'test/process/cancle_crm_lead.yml', - 'test/process/process_crm_meeting.yml', + 'test/process/crm_meeting.yml', 'test/test_crm_opportunity.yml', 'test/process/process_crm_phonecall.yml', 'test/test_crm_recurrent_meeting.yml', From e355b8b55d9995bb4533fac1f914a83908159f32 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Wed, 12 Oct 2011 17:26:44 +0530 Subject: [PATCH 013/132] [ADD] crm: 1) Added lead_form.yml, 2) Covered onchange_partner operation and unlink operation bzr revid: ron@tinyerp.com-20111012115644-q91ejya01c8k28m1 --- addons/crm/__openerp__.py | 1 + addons/crm/test/ui/lead_form.yml | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 addons/crm/test/ui/lead_form.yml diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index 51489fd5aa4..dee4a6766ed 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -123,6 +123,7 @@ Creates a dashboard for CRM that includes: 'test/process/crm_lead_to_opportunity.yml', 'test/process/cancle_crm_lead.yml', 'test/process/crm_meeting.yml', + 'test/ui/lead_form.yml', 'test/test_crm_opportunity.yml', 'test/process/process_crm_phonecall.yml', 'test/test_crm_recurrent_meeting.yml', diff --git a/addons/crm/test/ui/lead_form.yml b/addons/crm/test/ui/lead_form.yml new file mode 100644 index 00000000000..5ad241ca104 --- /dev/null +++ b/addons/crm/test/ui/lead_form.yml @@ -0,0 +1,20 @@ +- + In order to check for changes on partner, data will be change automatically according to partner, +- + !python {model: crm.lead}: | + action = self.onchange_partner_address_id(cr, uid, ref("crm_case_initialdiscussion0"), ref("base.res_partner_address_notsotinysarl0"), email=False) + assert action['value']['country_id'] == 20, "Country name not True" + assert action['value']['phone'] == '(+32).81.81.37.00', "phone number is wrong" +- + I try to Unlink the Lead I create new record of lead. +- + !record {model: crm.lead, id: crm_lead_intested_openerp}: + name: Interested in openerp +- + In order to test unlink lead, i will do unlink this lead +- + !python {model: crm.lead}: | + from tools.translate import _ + self.unlink(cr, uid, [ref("crm_lead_intested_openerp")]) + id = self.search(cr, uid, [('id', '=', ref("crm_lead_intested_openerp"))]) + assert len(id) < 1, _('Lead is not deleted') From 0df8ef1c6c7b3f0154efb8717617bf9d7b68b2ac Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Wed, 12 Oct 2011 17:51:41 +0530 Subject: [PATCH 014/132] [REF] crm: 1) Rename process_crm_phonecall.yml to crm_phonecall.yml, 2) Covered phonecall and its coverted to opportunity and close this phonecall bzr revid: ron@tinyerp.com-20111012122141-7slvyilesfbxq1cw --- addons/crm/test/process/crm_phonecall.yml | 34 +++++++++ .../test/process/process_crm_phonecall.yml | 73 ------------------- 2 files changed, 34 insertions(+), 73 deletions(-) create mode 100644 addons/crm/test/process/crm_phonecall.yml delete mode 100644 addons/crm/test/process/process_crm_phonecall.yml diff --git a/addons/crm/test/process/crm_phonecall.yml b/addons/crm/test/process/crm_phonecall.yml new file mode 100644 index 00000000000..541f92133fe --- /dev/null +++ b/addons/crm/test/process/crm_phonecall.yml @@ -0,0 +1,34 @@ +- | + For customer or partner purpose, I called to him/her for discussion about openerp. + As the success of phonecall seems to be a real business opportunity, It will convert + it to opportunity. +- + !record {model: crm.phonecall2opportunity, id: crm_phonecall2opportunity_disc_openerp}: + name: Discuss Review Process + partner_id: base.res_partner_tinyatwork + planned_revenue: 0.0 + probability: 0.0 +- | + Business opportunity is now assigned to this phonecall. +- + !assert {model: crm.phonecall, id: crm_case_phone04}: + - opportunity_id != False +- + Succeed phonecall, it will be convert into on opportunity. +- + !python {model: crm.phonecall2opportunity}: | + self.action_apply(cr, uid, [ref("crm_phonecall2opportunity_disc_openerp")], {"active_id": ref("crm_case_phone04")}) +- | + For business And I check that the phonecall and the newly created business + opportunity is linked to same partner. +- + !python {model: crm.phonecall}: | + obj_phonecall = self.browse(cr, uid, ref('crm_case_phone04')) + ids = self.pool.get('crm.lead').search(cr, uid, [('name', '=', obj_phonecall.opportunity_id.name)]) + obj_opp = self.pool.get('crm.lead').browse(cr, uid, ids)[0] + assert obj_phonecall.partner_id == obj_opp.partner_id, "created business opportunity is not linked to same partner" +- + Completion of phonecall, Cheking for phonecall summary is close or not. +- + !assert {model: crm.phonecall, id: crm.crm_case_phone04, string: phonecall is held}: + - state == 'done' diff --git a/addons/crm/test/process/process_crm_phonecall.yml b/addons/crm/test/process/process_crm_phonecall.yml deleted file mode 100644 index 25f3069fac6..00000000000 --- a/addons/crm/test/process/process_crm_phonecall.yml +++ /dev/null @@ -1,73 +0,0 @@ -- | - For customer or partner purpose, I called to him/her for discussion about openerp. -- - !record {model: crm.phonecall, id: crm_phonecall_disc_openerp}: - date: !eval time.strftime('%Y-%m-%d 08:00:00') - name: Discussion About Openerp - duration: 2.0 - section_id: crm.section_sales_department -- - After called to Customer/partner, So creating record to merge with exiting partner -- - !record {model: crm.phonecall2partner, id: crm_phonecall2partner_existed}: - action: exist - partner_id: base.res_partner_9 - -- - We are going to create partner. -- - !python {model: crm.phonecall2partner}: | - - self._select_partner(cr, uid,{"active_ids": [ref("crm_phonecall_disc_openerp")]}) - self.open_create_partner(cr, uid, [ref("crm_phonecall2partner_existed")], {"active_ids": [ref("crm_phonecall_disc_openerp")]}) - self.make_partner(cr, uid, [ref("crm_phonecall2partner_existed")], {"active_ids": [ref("crm_phonecall_disc_openerp")]}) - -- | - As the success of phonecall seems to be a real business opportunity, It will convert - it to opportunity. -- - !record {model: crm.phonecall2opportunity, id: crm_phonecall2opportunity_disc_openerp}: - name: Discussion About Openerp - partner_id: base.res_partner_9 - planned_revenue: 0.0 - probability: 0.0 -- | - Business opportunity is now assigned to this phonecall. -- - !assert {model: crm.phonecall, id: crm_phonecall_disc_openerp}: - - opportunity_id != False -- - Succeed phonecall, it will be convert into on opportunity. -- - !python {model: crm.phonecall2opportunity}: | - self.action_apply(cr, uid, [ref("crm_phonecall2opportunity_disc_openerp")], {"active_id": ref("crm_phonecall_disc_openerp")}) -- | - For business And I check that the phonecall and the newly created business - opportunity is linked to same partner. -- - !python {model: crm.phonecall}: | - obj_phonecall = self.browse(cr, uid, ref('crm_phonecall_disc_openerp')) - ids = self.pool.get('crm.lead').search(cr, uid, [('name', '=', obj_phonecall.opportunity_id.name)]) - obj_opp = self.pool.get('crm.lead').browse(cr, uid, ids)[0] - assert obj_phonecall.partner_id == obj_opp.partner_id -- | - Customer/partner intested with our product, so we will call back to him/her -- - !record {model: crm.phonecall2phonecall, id: crm_phonecall2phonecall_disc_openerp}: - date: !eval "'%s-%s-%s 19:49:00' %(datetime.now().year,datetime.now().month,datetime.now().day)" - name: interest with openerp - section_id: crm.section_sales_department - user_id: base.user_root - action: schedule - categ_id: crm.categ_phone1 -- | - Create other sedular call which is interested customer/partner. -- - !python {model: crm.phonecall2phonecall}: | - self.action_apply(cr, uid, [ref('crm_phonecall2phonecall_disc_openerp')], {'active_id': ref('crm_phonecall_disc_openerp')}) -- | - Completion of phonecall, Cheking for phonecall summary is close or not. -- - !python {model: crm.phonecall}: | - phonecall_rec = self.browse(cr, uid, ref('crm_phonecall_disc_openerp')) - assert phonecall_rec.state == 'done', "Phonecall is not in done state" From cbe30f479ebbfacaf2fd2f287a40efa759227b52 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Wed, 12 Oct 2011 18:07:50 +0530 Subject: [PATCH 015/132] [IMP] crm: 1) Improvement in openerp for correct path of crm_phonecall.yml bzr revid: ron@tinyerp.com-20111012123750-31997j4tkpx4odjt --- addons/crm/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index dee4a6766ed..ff9030cc2e8 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -125,7 +125,7 @@ Creates a dashboard for CRM that includes: 'test/process/crm_meeting.yml', 'test/ui/lead_form.yml', 'test/test_crm_opportunity.yml', - 'test/process/process_crm_phonecall.yml', + 'test/process/crm_phonecall.yml', 'test/test_crm_recurrent_meeting.yml', 'test/test_crm_stage_changes.yml', 'test/test_crm_recurrent_meeting_case2.yml', From 8e32600b09b62c0edd505c2c974c9fa99dad457d Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Wed, 12 Oct 2011 18:22:13 +0530 Subject: [PATCH 016/132] [IMP] crm: Add more assert cheking and remove initial checking on crm_phonecall.yml bzr revid: ron@tinyerp.com-20111012125213-yq4vhekyblxl7017 --- addons/crm/test/process/crm_phonecall.yml | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/addons/crm/test/process/crm_phonecall.yml b/addons/crm/test/process/crm_phonecall.yml index 541f92133fe..7f81a7d86fc 100644 --- a/addons/crm/test/process/crm_phonecall.yml +++ b/addons/crm/test/process/crm_phonecall.yml @@ -8,11 +8,6 @@ partner_id: base.res_partner_tinyatwork planned_revenue: 0.0 probability: 0.0 -- | - Business opportunity is now assigned to this phonecall. -- - !assert {model: crm.phonecall, id: crm_case_phone04}: - - opportunity_id != False - Succeed phonecall, it will be convert into on opportunity. - @@ -20,15 +15,13 @@ self.action_apply(cr, uid, [ref("crm_phonecall2opportunity_disc_openerp")], {"active_id": ref("crm_case_phone04")}) - | For business And I check that the phonecall and the newly created business - opportunity is linked to same partner. + opportunity is linked to same partner and also check with phonecall close or not. - !python {model: crm.phonecall}: | obj_phonecall = self.browse(cr, uid, ref('crm_case_phone04')) ids = self.pool.get('crm.lead').search(cr, uid, [('name', '=', obj_phonecall.opportunity_id.name)]) obj_opp = self.pool.get('crm.lead').browse(cr, uid, ids)[0] assert obj_phonecall.partner_id == obj_opp.partner_id, "created business opportunity is not linked to same partner" -- - Completion of phonecall, Cheking for phonecall summary is close or not. -- - !assert {model: crm.phonecall, id: crm.crm_case_phone04, string: phonecall is held}: - - state == 'done' + assert obj_opp.stage_id.name == "New", "Converted opportunity is not in New stage" + assert obj_opp.stage_id.probability == 10.0, "Probability of opportunity is 10.0" + assert obj_phonecall.state == "done", "phonecall is held" From 371ad07f80ff9210a0f309c888392609029d312d Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Wed, 12 Oct 2011 18:54:02 +0530 Subject: [PATCH 017/132] [REF] crm : 1) Renamed cancle_crm_lead.yml to cancel_lead.yml, 2)Renamed crm_lead_to_opportunity.yml to lead2opportunity.yml, 3)Renamed crm_lead_open.yml to lead_open.yml 4)Renamed crm_meeting.yml to meeting.yml 5)Renamed crm_phonecall.yml to phonecall2opportunity.yml bzr revid: ron@tinyerp.com-20111012132402-9xichtqjqdwo5g8i --- addons/crm/test/process/{cancle_crm_lead.yml => cancel_lead.yml} | 0 .../process/{crm_lead_to_opportunity.yml => lead2opportunity.yml} | 0 addons/crm/test/process/{crm_lead_open.yml => lead_open.yml} | 0 addons/crm/test/process/{crm_meeting.yml => meeting.yml} | 0 .../test/process/{crm_phonecall.yml => phonecall2opportunity.yml} | 0 5 files changed, 0 insertions(+), 0 deletions(-) rename addons/crm/test/process/{cancle_crm_lead.yml => cancel_lead.yml} (100%) rename addons/crm/test/process/{crm_lead_to_opportunity.yml => lead2opportunity.yml} (100%) rename addons/crm/test/process/{crm_lead_open.yml => lead_open.yml} (100%) rename addons/crm/test/process/{crm_meeting.yml => meeting.yml} (100%) rename addons/crm/test/process/{crm_phonecall.yml => phonecall2opportunity.yml} (100%) diff --git a/addons/crm/test/process/cancle_crm_lead.yml b/addons/crm/test/process/cancel_lead.yml similarity index 100% rename from addons/crm/test/process/cancle_crm_lead.yml rename to addons/crm/test/process/cancel_lead.yml diff --git a/addons/crm/test/process/crm_lead_to_opportunity.yml b/addons/crm/test/process/lead2opportunity.yml similarity index 100% rename from addons/crm/test/process/crm_lead_to_opportunity.yml rename to addons/crm/test/process/lead2opportunity.yml diff --git a/addons/crm/test/process/crm_lead_open.yml b/addons/crm/test/process/lead_open.yml similarity index 100% rename from addons/crm/test/process/crm_lead_open.yml rename to addons/crm/test/process/lead_open.yml diff --git a/addons/crm/test/process/crm_meeting.yml b/addons/crm/test/process/meeting.yml similarity index 100% rename from addons/crm/test/process/crm_meeting.yml rename to addons/crm/test/process/meeting.yml diff --git a/addons/crm/test/process/crm_phonecall.yml b/addons/crm/test/process/phonecall2opportunity.yml similarity index 100% rename from addons/crm/test/process/crm_phonecall.yml rename to addons/crm/test/process/phonecall2opportunity.yml From 08a288eceabce77145d59d1775ef5e903912541c Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Thu, 13 Oct 2011 10:42:32 +0530 Subject: [PATCH 018/132] [IMP]: crm: All changes done on lead2opportunity.yml 1) string improved from lead to opportunity when lead has been qualified 2) checked probability after opportunity had won bzr revid: ron@tinyerp.com-20111013051232-k9oih94g1fvmdhbh --- addons/crm/test/process/lead2opportunity.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/addons/crm/test/process/lead2opportunity.yml b/addons/crm/test/process/lead2opportunity.yml index 2c1ccc65bfb..db85d634b21 100644 --- a/addons/crm/test/process/lead2opportunity.yml +++ b/addons/crm/test/process/lead2opportunity.yml @@ -15,22 +15,23 @@ !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: Lead is not converted on opportunity}: - type == 'opportunity' - - Finally, i won this lead, so i will close this lead. + Finally, i won this opportunity, so i will close this lead. - !python {model: crm.lead}: | self.case_mark_won(cr, uid, [ref("crm_case_qrecorp0")]) - - In order to test lead, it is close or not. + In order to test opportunity, it is close or not. - !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: Lead in done state}: - state == "done" -- - After won this lead probability is 100. -- - !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: Probability is equal to 100}: - - probability == 100.0 - In order to test stage of opportunity after win, i will test stage of opportunity. - !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: stage of opportunity is win}: - stage_id.name == "Won" +- + After won the opportunity, i will test probability is 100. +- + !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: Probability is equal to 100}: + - probability == 100.0 + \ No newline at end of file From 0d3652a60b657ad055634276c3de2519414d61e3 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Thu, 13 Oct 2011 11:06:51 +0530 Subject: [PATCH 019/132] [IMP] crm : All renamed file name Updated on __opnerp.py file bzr revid: ron@tinyerp.com-20111013053651-yfoku3auqg1s730i --- addons/crm/__openerp__.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index ff9030cc2e8..54cc33c1dd9 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -119,13 +119,13 @@ Creates a dashboard for CRM that includes: 'crm_phonecall_demo.xml', ], 'test': [ - 'test/process/crm_lead_open.yml', - 'test/process/crm_lead_to_opportunity.yml', - 'test/process/cancle_crm_lead.yml', - 'test/process/crm_meeting.yml', + 'test/process/lead_open.yml', + 'test/process/lead2opportunity.yml', + 'test/process/cancel_lead.yml', + 'test/process/meeting.yml', 'test/ui/lead_form.yml', 'test/test_crm_opportunity.yml', - 'test/process/crm_phonecall.yml', + 'test/process/phonecall2opportunity.yml', 'test/test_crm_recurrent_meeting.yml', 'test/test_crm_stage_changes.yml', 'test/test_crm_recurrent_meeting_case2.yml', From 5cdcd1bf45ac8dee47c8fcba4adc44934456ace7 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Thu, 13 Oct 2011 11:22:09 +0530 Subject: [PATCH 020/132] [IMP]: crm: All changes done on phonecall2opportunity.yml 1) string improved because put more assert, 2) Removed code search by name Its done by id all bzr revid: ron@tinyerp.com-20111013055209-3e6741omkojcs9vm --- addons/crm/test/process/phonecall2opportunity.yml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/addons/crm/test/process/phonecall2opportunity.yml b/addons/crm/test/process/phonecall2opportunity.yml index 7f81a7d86fc..89b11a80f50 100644 --- a/addons/crm/test/process/phonecall2opportunity.yml +++ b/addons/crm/test/process/phonecall2opportunity.yml @@ -15,13 +15,11 @@ self.action_apply(cr, uid, [ref("crm_phonecall2opportunity_disc_openerp")], {"active_id": ref("crm_case_phone04")}) - | For business And I check that the phonecall and the newly created business - opportunity is linked to same partner and also check with phonecall close or not. + opportunity is linked to same partner and also check with phonecall closed and opportunity + is on intial stage or not. - !python {model: crm.phonecall}: | - obj_phonecall = self.browse(cr, uid, ref('crm_case_phone04')) - ids = self.pool.get('crm.lead').search(cr, uid, [('name', '=', obj_phonecall.opportunity_id.name)]) - obj_opp = self.pool.get('crm.lead').browse(cr, uid, ids)[0] - assert obj_phonecall.partner_id == obj_opp.partner_id, "created business opportunity is not linked to same partner" - assert obj_opp.stage_id.name == "New", "Converted opportunity is not in New stage" - assert obj_opp.stage_id.probability == 10.0, "Probability of opportunity is 10.0" - assert obj_phonecall.state == "done", "phonecall is held" + phonecall = self.browse(cr, uid, ref('crm_case_phone04')) + assert phonecall.partner_id.id == phonecall.opportunity_id.partner_id.id, "created business opportunity is not linked to same partner" + assert phonecall.opportunity_id.stage_id.id == ref("stage_lead1"), "Converted opportunity is not in Initial stage" + assert phonecall.state == "done", "phonecall is held" From f7da9553df2138294d98d5744a88b3cd4d6cb72c Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Thu, 13 Oct 2011 12:04:11 +0530 Subject: [PATCH 021/132] [REF, IMP]: crm: All changes done on cancel_lead.yml 1) Put more assert and done code more reliable, 2) checked all assert differently 3) Improved string bzr revid: ron@tinyerp.com-20111013063411-bestdccmzkqo8w4y --- addons/crm/test/process/cancel_lead.yml | 67 ++++++++++++++++++------- 1 file changed, 48 insertions(+), 19 deletions(-) diff --git a/addons/crm/test/process/cancel_lead.yml b/addons/crm/test/process/cancel_lead.yml index c8d02c6414c..3a3366c05e4 100644 --- a/addons/crm/test/process/cancel_lead.yml +++ b/addons/crm/test/process/cancel_lead.yml @@ -1,22 +1,43 @@ - - Cheking for lead from any stage, It will be cancle or not. + Cheking for lead from draft to cancel, I will cancelling this lead. - !python {model: crm.lead}: | - lead_on_draft=self.browse(cr, uid, ref("crm_case_itisatelesalescampaign0")) - assert lead_on_draft.state == 'draft', "Lead is not in draft state" self.case_cancel(cr, uid, [ref("crm_case_itisatelesalescampaign0")]) - lead_on_cancel=self.browse(cr, uid, ref("crm_case_itisatelesalescampaign0")) - assert lead_on_cancel.state == 'cancel', "Lead is not in cancel state" +- + In order to test for cancel lead , i will test lead is on cancel state. +- + !assert {model: crm.lead, id: crm.crm_case_itisatelesalescampaign0, string: Lead is in cancel state}: + - state == "cancel" +- + Cheking for lead from cancel to reset, I will reseting this lead. +- + !python {model: crm.lead}: | self.case_reset(cr, uid, [ref("crm_case_itisatelesalescampaign0")]) - lead_on_reset=self.browse(cr, uid, ref("crm_case_itisatelesalescampaign0")) - assert lead_on_reset.state == 'draft', "Lead is not in draft state" +- + In order to test for reset lead , i will test lead is on draft state. +- + !assert {model: crm.lead, id: crm.crm_case_itisatelesalescampaign0, string: Lead is in draft state}: + - state == "draft" +- + Cheking for lead from reset to pending, I will pending this lead. +- + !python {model: crm.lead}: | self.case_pending(cr, uid, [ref("crm_case_itisatelesalescampaign0")]) - lead_on_pending=self.browse(cr, uid, ref("crm_case_itisatelesalescampaign0")) - assert lead_on_pending.state == 'pending', "Lead is not in pending state" +- + In order to test for pending lead , i will test lead is on pending state. +- + !assert {model: crm.lead, id: crm.crm_case_itisatelesalescampaign0, string: Lead is in pending state}: + - state == "pending" +- + Cheking for lead from pending to cancel, I will cancelling this lead. +- + !python {model: crm.lead}: | self.case_cancel(cr, uid, [ref("crm_case_itisatelesalescampaign0")]) - lead_pending_cancel=self.browse(cr, uid, ref("crm_case_itisatelesalescampaign0")) - assert lead_pending_cancel.state == 'cancel', "Lead is not in cancel state" - +- + In order to test for cancel lead , i will test lead is on cancel state. +- + !assert {model: crm.lead, id: crm.crm_case_itisatelesalescampaign0, string: Lead is in cancel state}: + - state == "cancel" - For working on parent child relationship, we are creating sales executive department that will be work under Sales Department. @@ -36,13 +57,21 @@ department or not. - !python {model: crm.lead}: | - lead_rec=self.browse(cr, uid, ref("crm_case_itisatelesalescampaign0")) self.case_reset(cr, uid, [ref("crm_case_itisatelesalescampaign0")]) - lead_cancle_reset=self.browse(cr, uid, ref("crm_case_itisatelesalescampaign0")) - assert lead_cancle_reset.state == 'draft', "Lead is not in draft state" self.case_escalate(cr, uid, [ref("crm_case_itisatelesalescampaign0")]) - lead_on_escalate=self.browse(cr, uid, ref("crm_case_itisatelesalescampaign0")) - assert lead_on_escalate.section_id.name == 'Sales Department', "Do not Escalate lead to on sales team from Executive team" +- + In order to test for escalate lead , i will test lead Escalate from sales Department from Executive + department. +- + !assert {model: crm.lead, id: crm.crm_case_itisatelesalescampaign0, string: Escalate lead to on sales team from Executive teame}: + - section_id.name == "Sales Department" +- + Cheking for lead from escalate to cancel, I will cancelling this lead. +- + !python {model: crm.lead}: | self.case_cancel(cr, uid, [ref("crm_case_itisatelesalescampaign0")]) - lead_escalate_cancel=self.browse(cr, uid, ref("crm_case_itisatelesalescampaign0")) - assert lead_escalate_cancel.state == 'cancel', "Lead is not in cancel state" +- + In order to test for cancel lead , i will test lead is on cancel state. +- + !assert {model: crm.lead, id: crm.crm_case_itisatelesalescampaign0, string: Lead is in cancel state}: + - state == "cancel" From 57cc6f533c3ec69285922f68c5261457cdd81807 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Thu, 13 Oct 2011 12:40:53 +0530 Subject: [PATCH 022/132] [REF, IMP]: crm: default value removed from phonecall2opportunity.yml bzr revid: ron@tinyerp.com-20111013071053-nqzonf822815l3ey --- addons/crm/test/process/phonecall2opportunity.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/addons/crm/test/process/phonecall2opportunity.yml b/addons/crm/test/process/phonecall2opportunity.yml index 89b11a80f50..2575daf8665 100644 --- a/addons/crm/test/process/phonecall2opportunity.yml +++ b/addons/crm/test/process/phonecall2opportunity.yml @@ -6,8 +6,6 @@ !record {model: crm.phonecall2opportunity, id: crm_phonecall2opportunity_disc_openerp}: name: Discuss Review Process partner_id: base.res_partner_tinyatwork - planned_revenue: 0.0 - probability: 0.0 - Succeed phonecall, it will be convert into on opportunity. - From 5fb61d943f311c81ed52572bbf60fa785c160035 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Thu, 13 Oct 2011 14:41:23 +0530 Subject: [PATCH 023/132] [REF, IMP]: crm: All changes done on lead_form.yml 1) Added lead on form for copy and delete function 2) Checked code according to delete lead bzr revid: ron@tinyerp.com-20111013091123-refu3d0l1b7g7swl --- addons/crm/test/ui/lead_form.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/addons/crm/test/ui/lead_form.yml b/addons/crm/test/ui/lead_form.yml index 5ad241ca104..2e73aa5766b 100644 --- a/addons/crm/test/ui/lead_form.yml +++ b/addons/crm/test/ui/lead_form.yml @@ -2,19 +2,20 @@ In order to check for changes on partner, data will be change automatically according to partner, - !python {model: crm.lead}: | - action = self.onchange_partner_address_id(cr, uid, ref("crm_case_initialdiscussion0"), ref("base.res_partner_address_notsotinysarl0"), email=False) + action = self.onchange_partner_address_id(cr, uid, ref("crm_case_qrecorp0"), ref("base.res_partner_address_notsotinysarl0"), email=False) assert action['value']['country_id'] == 20, "Country name not True" assert action['value']['phone'] == '(+32).81.81.37.00', "phone number is wrong" - I try to Unlink the Lead I create new record of lead. - - !record {model: crm.lead, id: crm_lead_intested_openerp}: - name: Interested in openerp + !record {model: crm.lead, id: crm_case_new_lead}: + name: Opnerp Trainning + state: cancel - In order to test unlink lead, i will do unlink this lead - !python {model: crm.lead}: | - from tools.translate import _ - self.unlink(cr, uid, [ref("crm_lead_intested_openerp")]) - id = self.search(cr, uid, [('id', '=', ref("crm_lead_intested_openerp"))]) - assert len(id) < 1, _('Lead is not deleted') + try: + self.unlink(cr, uid, [ref("crm_case_new_lead")]) + except: + pass From 213fa886f1603853779b17282caa77323f564c5c Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Thu, 13 Oct 2011 14:59:24 +0530 Subject: [PATCH 024/132] [REF, IMP]: crm: Added copy of lead and checked on lead_form.yml bzr revid: ron@tinyerp.com-20111013092924-oowazupgpnajrqpb --- addons/crm/test/ui/lead_form.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/crm/test/ui/lead_form.yml b/addons/crm/test/ui/lead_form.yml index 2e73aa5766b..c6cbbb3fcb2 100644 --- a/addons/crm/test/ui/lead_form.yml +++ b/addons/crm/test/ui/lead_form.yml @@ -9,12 +9,15 @@ I try to Unlink the Lead I create new record of lead. - !record {model: crm.lead, id: crm_case_new_lead}: - name: Opnerp Trainning + name: Openerp Trainning state: cancel - In order to test unlink lead, i will do unlink this lead - !python {model: crm.lead}: | + self.copy(cr, uid, ref("crm_case_new_lead")) + sid = self.search(cr, uid, [('name', '=', 'Openerp Trainning')]) + assert len(sid) == 2, 'Lead is not copied Successfully' try: self.unlink(cr, uid, [ref("crm_case_new_lead")]) except: From 65304c97f773ad20c03105b5b6678cb84e856698 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Thu, 13 Oct 2011 17:13:04 +0530 Subject: [PATCH 025/132] [REF]: crm: Added more checking after convert opportunity from lead and also added partner on existing record on lead2opportunity.yml bzr revid: ron@tinyerp.com-20111013114304-wuxvpnnmubtc9s8r --- addons/crm/test/process/lead2opportunity.yml | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/addons/crm/test/process/lead2opportunity.yml b/addons/crm/test/process/lead2opportunity.yml index db85d634b21..5a9668adfd3 100644 --- a/addons/crm/test/process/lead2opportunity.yml +++ b/addons/crm/test/process/lead2opportunity.yml @@ -2,18 +2,24 @@ As the lead seems to be a real business opportunity, I will convert it to a partner and a business opportunity. - - !record {model: crm.lead2opportunity.partner, id: crm_lead2opportunity_partner_create_1}: - action: 'exist' + !record {model: crm.lead2opportunity.partner, id: crm_lead2opportunity_partner_create_1}: + action: 'exist' + partner_id: base.res_partner_agrolait - Create opportunity based on exiting partner - - !python {model: crm.lead2opportunity.partner}: | - self.action_apply(cr, uid, [ref("crm_lead2opportunity_partner_create_1")], {'active_ids': [ref("crm_case_qrecorp0")], 'active_id': ref("crm_case_qrecorp0")}) + !python {model: crm.lead2opportunity.partner}: | + self.action_apply(cr, uid, [ref("crm_lead2opportunity_partner_create_1")], {'active_ids': [ref("crm_case_qrecorp0")], 'active_id': ref("crm_case_qrecorp0")}) - In order to test lead, i will test to lead is converted to opportunity. - - !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: Lead is not converted on opportunity}: - - type == 'opportunity' + !python {model: crm.lead}: | + lead = self.browse(cr, uid, ref('crm_case_qrecorp0')) + assert lead.type == 'opportunity', 'Lead is not converted to opportunity!' + assert lead.planned_revenue == 0.0, 'Planned revenue should be 0!' + assert lead.probability == 0.0, 'probability revenue should be 0!' + assert lead.partner_id.id == ref("base.res_partner_agrolait"), 'Partner missmatch!' + assert lead.stage_id.id == ref("stage_lead1"), 'Stage of probability is incorrect!' - Finally, i won this opportunity, so i will close this lead. - @@ -34,4 +40,3 @@ - !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: Probability is equal to 100}: - probability == 100.0 - \ No newline at end of file From c8b4c07d9b5bbf256249e9c51d6d5e83cf8b60cd Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Thu, 13 Oct 2011 18:42:02 +0530 Subject: [PATCH 026/132] [ADD]: crm: Added new yml lead2_mass_convert_opportunity.yml 1) cheked convert two lead to opportunity. 2) Checked record according to lead bzr revid: ron@tinyerp.com-20111013131202-aku0tvzavpyz4efp --- addons/crm/__openerp__.py | 1 + .../lead2_mass_convert_opportunity.yml | 32 +++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 addons/crm/test/process/lead2_mass_convert_opportunity.yml diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index 54cc33c1dd9..508c7dff370 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -123,6 +123,7 @@ Creates a dashboard for CRM that includes: 'test/process/lead2opportunity.yml', 'test/process/cancel_lead.yml', 'test/process/meeting.yml', + 'test/process/lead2_mass_convert_opportunity.yml', 'test/ui/lead_form.yml', 'test/test_crm_opportunity.yml', 'test/process/phonecall2opportunity.yml', diff --git a/addons/crm/test/process/lead2_mass_convert_opportunity.yml b/addons/crm/test/process/lead2_mass_convert_opportunity.yml new file mode 100644 index 00000000000..22c22d7a376 --- /dev/null +++ b/addons/crm/test/process/lead2_mass_convert_opportunity.yml @@ -0,0 +1,32 @@ +- + Using mass wizard, convert two lead to opportunity. +- + !record {model: crm.lead2opportunity.partner.mass, id: crm_lead2opportunity_partner_mass0}: + user_ids: + - base.user_root + section_id: crm.section_sales_department +- + Leads coverts to mass opportunity. +- + !python {model: crm.lead2opportunity.partner.mass}: | + self.mass_convert(cr, uid, [ref("crm_lead2opportunity_partner_mass0")],{'active_ids': [ref("crm_case_employee0"), ref("crm_case_electonicgoodsdealer0")], 'active_id': ref("crm_case_qrecorp0")}) +- + First lead converted on opportunity.i test it. +- + !python {model: crm.lead}: | + lead = self.browse(cr, uid, ref('crm_case_employee0')) + assert lead.type == 'opportunity', 'Lead is not converted to opportunity!' + assert lead.planned_revenue == 0.0, 'Planned revenue should be 0!' + assert lead.probability == 0.0, 'probability revenue should be 0!' + assert lead.partner_id.name == "Agrolait", 'Partner missmatch!' + assert lead.stage_id.id == ref("stage_lead1"), 'Stage of probability is incorrect!' +- + Second lead converted on opportunity.i test it. +- + !python {model: crm.lead}: | + lead = self.browse(cr, uid, ref('crm_case_electonicgoodsdealer0')) + assert lead.type == 'opportunity', 'Lead is not converted to opportunity!' + assert lead.planned_revenue == 0.0, 'Planned revenue should be 0!' + assert lead.probability == 0.0, 'probability revenue should be 0!' + assert lead.partner_id.name == "Le Club SARL", 'Partner missmatch!' + assert lead.stage_id.id == ref("stage_lead1"), 'Stage of probability is incorrect!' From a589f59ee9822e71020c4da02957852d5a223316 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Fri, 14 Oct 2011 11:54:32 +0530 Subject: [PATCH 027/132] [ADD]: crm: Added new yml merge2opportunity.yml 1) Merged two opportunity. 2) Checked Merged opportunity succeed bzr revid: ron@tinyerp.com-20111014062432-gywyd1nevu33wfwy --- addons/crm/__openerp__.py | 1 + addons/crm/test/process/merge2opportunity.yml | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 addons/crm/test/process/merge2opportunity.yml diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index 508c7dff370..7a30166b46d 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -122,6 +122,7 @@ Creates a dashboard for CRM that includes: 'test/process/lead_open.yml', 'test/process/lead2opportunity.yml', 'test/process/cancel_lead.yml', + 'test/process/merge2opportunity.yml', 'test/process/meeting.yml', 'test/process/lead2_mass_convert_opportunity.yml', 'test/ui/lead_form.yml', diff --git a/addons/crm/test/process/merge2opportunity.yml b/addons/crm/test/process/merge2opportunity.yml new file mode 100644 index 00000000000..2161e191a81 --- /dev/null +++ b/addons/crm/test/process/merge2opportunity.yml @@ -0,0 +1,17 @@ +- + I Merge two Opportunities. +- + !python {model: crm.merge.opportunity}: | + op_ids=self.pool.get('crm.lead').browse(cr, uid, [ref('crm_case_bankwealthy2'), ref('crm_case_unifliege')]) + self.merge(cr, uid, op_ids) + +- + I will test merged two opportunity. +- + !python {model: crm.lead}: | + lead = self.browse(cr, uid, ref('crm_case_bankwealthy2')) + merge = 'Merged opportunities' in lead.message_ids[0].subject + assert merge,'Fail to create Merge opportunity' + assert lead.type == 'opportunity', 'Merged opportunity type not change!' + assert lead.partner_id.id == ref("base.res_partner_accent"), 'Partner missmatch!' + assert lead.stage_id.id == ref("stage_lead2"), 'Stage of probability is incorrect!' From 2e897842ff538499e679d424789772124154740f Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Fri, 14 Oct 2011 12:50:00 +0530 Subject: [PATCH 028/132] [REM]: crm: 1)Removed test_crm_opportunity.yml, 2)Removed test_crm_lead_case2.yml, 3)Removed test_crm_opportunity_case2.yml bzr revid: ron@tinyerp.com-20111014072000-yl3q15mdimss6fri --- addons/crm/__openerp__.py | 3 - addons/crm/test/test_crm_lead_case2.yml | 151 ------------------ addons/crm/test/test_crm_opportunity.yml | 113 ------------- .../crm/test/test_crm_opportunity_case2.yml | 45 ------ 4 files changed, 312 deletions(-) delete mode 100644 addons/crm/test/test_crm_lead_case2.yml delete mode 100644 addons/crm/test/test_crm_opportunity.yml delete mode 100644 addons/crm/test/test_crm_opportunity_case2.yml diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index 7a30166b46d..e3bd172d4e1 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -126,13 +126,10 @@ Creates a dashboard for CRM that includes: 'test/process/meeting.yml', 'test/process/lead2_mass_convert_opportunity.yml', 'test/ui/lead_form.yml', - 'test/test_crm_opportunity.yml', 'test/process/phonecall2opportunity.yml', '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', - 'test/test_crm_opportunity_case2.yml', 'test/test_crm_phonecall_case2.yml', 'test/test_crm_partner2opportunity.yml', 'test/test_crm_segmentation.yml', diff --git a/addons/crm/test/test_crm_lead_case2.yml b/addons/crm/test/test_crm_lead_case2.yml deleted file mode 100644 index af1b7e7e07b..00000000000 --- a/addons/crm/test/test_crm_lead_case2.yml +++ /dev/null @@ -1,151 +0,0 @@ -- - 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 "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: Test Sales Team - name: Test 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 -- - I assign segmentation. -- - !record {model: res.users, id: base.user_root}: - context_section_id: crm_case_section_demosalesteam -- | - 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: Test 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 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 "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 "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 "Test Customer" Lead. -- - !python {model: crm.lead}: | - self.on_change_optout(cr, uid, ref("crm_lead_democustomer"), True) - -- - 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 "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 "Test 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 "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 "Test Customer" demo Lead. -- - !python {model: crm.lead}: | - try: - self.unlink(cr, uid, [ref("crm_lead_democustomer")]) - except: - pass -- - 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 "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 "Test Customer" Parent "Sales Team". -- - !python {model: crm.lead}: | - self.case_escalate(cr, uid, [ref("crm_lead_democustomer")]) -- - 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 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) - -- - I Copying this lead "Test Customer" to New Lead. -- - !python {model: crm.lead}: | - self.copy(cr, uid, ref("crm_lead_democustomer")) -- - I checking the Lead Copied or Not. -- - !python {model: crm.lead}: | - sid = self.search(cr, uid, [('name', '=', 'Test Customer'),('state', '=', 'draft')]) - if not sid: - raise AssertionError("Lead is not copied Successfully") diff --git a/addons/crm/test/test_crm_opportunity.yml b/addons/crm/test/test_crm_opportunity.yml deleted file mode 100644 index 8f171311b4d..00000000000 --- a/addons/crm/test/test_crm_opportunity.yml +++ /dev/null @@ -1,113 +0,0 @@ -- | - 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_abcfuelcounits0}: - email_from: info@balmerinc.be - name: 'ABC 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 check that the opportunity is in 'New' state. -- - !assert {model: crm.lead, id: crm_opportunity_abcfuelcounits0}: - - state == "draft" - -- | - 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". -- - !python {model: crm.lead}: | - self.action_makeMeeting(cr, uid, [ref("crm_opportunity_abcfuelcounits0")]) - -- | - 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. -- - !record {model: crm.meeting, id: crm_meeting_abcfuelcounits0}: - date: !eval time.strftime('%Y-%m-%d 00:00:00') - date_deadline: !eval time.strftime('%Y-%m-%d 08:00:00') - duration: 8.0 - email_from: info@balmerinc.be - name: 'ABC FUEL CO 829264 - 10002 units' - opportunity_id: 'crm_opportunity_abcfuelcounits0' - partner_address_id: base.res_partner_address_1 - partner_id: base.res_partner_9 - section_id: crm.section_sales_department - state: open -- | - In order to schedule a phonecall to the partner - 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')" - 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 opportunity2phoncall wizard. -- - !python {model: crm.opportunity2phonecall}: | - self.action_apply(cr, uid, [ref('crm_opportunity2phonecall_abcfuelcounits0')], {'active_ids': [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') - ids = phone_obj.search(cr, uid, [('name', '=', 'ABC FUEL CO 829264 - 10002 units')]) - assert len(ids) -- | - 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')" - duration: 3.0 - name: 'ABC FUEL CO 829264 - 10002 units' - partner_address_id: base.res_partner_address_1 - partner_id: base.res_partner_9 - section_id: crm.section_sales_department -- | - I 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 -- - I 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_case_qrecorp0')] - self.merge(cr, uid, op_ids, {'lead_ids': lead_ids}) diff --git a/addons/crm/test/test_crm_opportunity_case2.yml b/addons/crm/test/test_crm_opportunity_case2.yml deleted file mode 100644 index dc0dbe517f1..00000000000 --- a/addons/crm/test/test_crm_opportunity_case2.yml +++ /dev/null @@ -1,45 +0,0 @@ -- | - 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 7ed74f873e9caebbd0de77f099dfb95ba7df95f4 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Fri, 14 Oct 2011 14:24:06 +0530 Subject: [PATCH 029/132] [REM, IMP]: crm: 1)Removed merge2opportunity.yml, 2)Merged two Opportunities code moved to lead2opportunity.yml bzr revid: ron@tinyerp.com-20111014085406-fg8javdjiohh6ojh --- addons/crm/__openerp__.py | 1 - addons/crm/test/process/lead2opportunity.yml | 18 ++++++++++++++++++ addons/crm/test/process/merge2opportunity.yml | 17 ----------------- 3 files changed, 18 insertions(+), 18 deletions(-) delete mode 100644 addons/crm/test/process/merge2opportunity.yml diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index e3bd172d4e1..6d05d3edd3d 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -122,7 +122,6 @@ Creates a dashboard for CRM that includes: 'test/process/lead_open.yml', 'test/process/lead2opportunity.yml', 'test/process/cancel_lead.yml', - 'test/process/merge2opportunity.yml', 'test/process/meeting.yml', 'test/process/lead2_mass_convert_opportunity.yml', 'test/ui/lead_form.yml', diff --git a/addons/crm/test/process/lead2opportunity.yml b/addons/crm/test/process/lead2opportunity.yml index 5a9668adfd3..75026ccfb3e 100644 --- a/addons/crm/test/process/lead2opportunity.yml +++ b/addons/crm/test/process/lead2opportunity.yml @@ -40,3 +40,21 @@ - !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: Probability is equal to 100}: - probability == 100.0 +- + I have two opportunity ,so i will merge this two Opportunities. +- + !python {model: crm.merge.opportunity}: | + op_ids=self.pool.get('crm.lead').browse(cr, uid, [ref('crm_case_bankwealthy2'), ref('crm_case_unifliege')]) + self.merge(cr, uid, op_ids) + +- + I will test which two opportunity merged . +- + !python {model: crm.lead}: | + lead = self.browse(cr, uid, ref('crm_case_bankwealthy2')) + merge = 'Merged opportunities' in lead.message_ids[0].subject + assert merge,'Fail to create Merge opportunity' + assert lead.type == 'opportunity', 'Merged opportunity type not change!' + assert lead.partner_id.id == ref("base.res_partner_accent"), 'Partner missmatch!' + assert lead.stage_id.id == ref("stage_lead2"), 'Stage of probability is incorrect!' + \ No newline at end of file diff --git a/addons/crm/test/process/merge2opportunity.yml b/addons/crm/test/process/merge2opportunity.yml deleted file mode 100644 index 2161e191a81..00000000000 --- a/addons/crm/test/process/merge2opportunity.yml +++ /dev/null @@ -1,17 +0,0 @@ -- - I Merge two Opportunities. -- - !python {model: crm.merge.opportunity}: | - op_ids=self.pool.get('crm.lead').browse(cr, uid, [ref('crm_case_bankwealthy2'), ref('crm_case_unifliege')]) - self.merge(cr, uid, op_ids) - -- - I will test merged two opportunity. -- - !python {model: crm.lead}: | - lead = self.browse(cr, uid, ref('crm_case_bankwealthy2')) - merge = 'Merged opportunities' in lead.message_ids[0].subject - assert merge,'Fail to create Merge opportunity' - assert lead.type == 'opportunity', 'Merged opportunity type not change!' - assert lead.partner_id.id == ref("base.res_partner_accent"), 'Partner missmatch!' - assert lead.stage_id.id == ref("stage_lead2"), 'Stage of probability is incorrect!' From 86e0aa5cc26e643cf04d1c4b6b4b32aaa758bafc Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Fri, 14 Oct 2011 14:29:03 +0530 Subject: [PATCH 030/132] [REM]: crm: 1)Removed test_crm_partner2opportunity.yml bzr revid: ron@tinyerp.com-20111014085903-b2i8gk93nuo5ckd5 --- addons/crm/__openerp__.py | 1 - .../crm/test/test_crm_partner2opportunity.yml | 25 ------------------- 2 files changed, 26 deletions(-) delete mode 100644 addons/crm/test/test_crm_partner2opportunity.yml diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index 6d05d3edd3d..58342283bbc 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -130,7 +130,6 @@ Creates a dashboard for CRM that includes: 'test/test_crm_stage_changes.yml', 'test/test_crm_recurrent_meeting_case2.yml', 'test/test_crm_phonecall_case2.yml', - 'test/test_crm_partner2opportunity.yml', 'test/test_crm_segmentation.yml', ], 'installable': True, diff --git a/addons/crm/test/test_crm_partner2opportunity.yml b/addons/crm/test/test_crm_partner2opportunity.yml deleted file mode 100644 index fe026074f4f..00000000000 --- a/addons/crm/test/test_crm_partner2opportunity.yml +++ /dev/null @@ -1,25 +0,0 @@ -- | - I start by creating a new opportunity from partner. -- - !record {model: crm.partner2opportunity, id: crm_partner2opportunity_id_0}: - name: test - planned_revenue: 0.0 - partner_id: base.res_partner_9 - probability: 0.0 -- - I click on "Create Opportunity" button of this wizard. -- - !python {model: crm.partner2opportunity}: | - 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. -- - !python {model: crm.partner2opportunity}: | - opportunity = self.make_opportunity(cr, uid, [ref("crm_partner2opportunity_id_0")], {"active_ids": [ref("crm_partner2opportunity_id_0")]}) - assert True From daeeef945d05e9b7a60c22f9e127f53f9c1f6314 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Fri, 14 Oct 2011 14:36:23 +0530 Subject: [PATCH 031/132] [REM]: crm: 1)Removed test_crm_phonecall_case2.yml 2) Updated __opeperp__.py bzr revid: ron@tinyerp.com-20111014090623-jf5atbxze6e9w8iv --- addons/crm/__openerp__.py | 1 - addons/crm/test/test_crm_phonecall_case2.yml | 26 -------------------- 2 files changed, 27 deletions(-) delete mode 100644 addons/crm/test/test_crm_phonecall_case2.yml diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index 58342283bbc..a4416ca8add 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -129,7 +129,6 @@ 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_phonecall_case2.yml', 'test/test_crm_segmentation.yml', ], 'installable': True, diff --git a/addons/crm/test/test_crm_phonecall_case2.yml b/addons/crm/test/test_crm_phonecall_case2.yml deleted file mode 100644 index 1b07121183c..00000000000 --- a/addons/crm/test/test_crm_phonecall_case2.yml +++ /dev/null @@ -1,26 +0,0 @@ -- | - 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 ff842dde4de206ac504120c59d6e9c3ae385b535 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Fri, 14 Oct 2011 15:06:28 +0530 Subject: [PATCH 032/132] [IMP]: crm: 1)All changes done in lead2opportunity.yml 2) Added scenario of when opportunity has been lost bzr revid: ron@tinyerp.com-20111014093628-j3o0m4ji3javmapb --- addons/crm/test/process/lead2opportunity.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/addons/crm/test/process/lead2opportunity.yml b/addons/crm/test/process/lead2opportunity.yml index 75026ccfb3e..108a0a74dbf 100644 --- a/addons/crm/test/process/lead2opportunity.yml +++ b/addons/crm/test/process/lead2opportunity.yml @@ -36,10 +36,24 @@ !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: stage of opportunity is win}: - stage_id.name == "Won" - - After won the opportunity, i will test probability is 100. + After winning the opportunity, i will test probability is 100. - !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: Probability is equal to 100}: - probability == 100.0 +- + Suppose i have opportinity in initial stage, i will check after loss my `opportunity` , probability of that opportunity is 0 +- + !python {model: crm.lead}: | + self.case_open(cr, uid, [ref("crm_case_rdroundfundingunits0")]) + self.case_mark_lost(cr, uid, [ref("crm_case_rdroundfundingunits0")]) +- + I check after loss the opportunity, probability set to 0.0 and lost stage set accordingly. +- + !python {model: crm.lead}: | + opportunity = self.browse(cr, uid, ref('crm_case_rdroundfundingunits0')) + assert opportunity.stage_id.id == ref('crm.stage_lead6'), 'Stage is not changed!' + assert opportunity.probability == 0.0, 'Probability is wrong!' + - I have two opportunity ,so i will merge this two Opportunities. - From 81c8f80edc17b6a8f904d5124d42e5fb454defd1 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Fri, 14 Oct 2011 15:12:57 +0530 Subject: [PATCH 033/132] [REM]: crm: Removed test_crm_stage_changes.yml bzr revid: ron@tinyerp.com-20111014094257-qmch5458436ibis4 --- addons/crm/__openerp__.py | 1 - addons/crm/test/test_crm_stage_changes.yml | 96 ---------------------- 2 files changed, 97 deletions(-) delete mode 100644 addons/crm/test/test_crm_stage_changes.yml diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index a4416ca8add..fdd841c2534 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -127,7 +127,6 @@ Creates a dashboard for CRM that includes: 'test/ui/lead_form.yml', 'test/process/phonecall2opportunity.yml', 'test/test_crm_recurrent_meeting.yml', - 'test/test_crm_stage_changes.yml', 'test/test_crm_recurrent_meeting_case2.yml', 'test/test_crm_segmentation.yml', ], diff --git a/addons/crm/test/test_crm_stage_changes.yml b/addons/crm/test/test_crm_stage_changes.yml deleted file mode 100644 index 391a328bffe..00000000000 --- a/addons/crm/test/test_crm_stage_changes.yml +++ /dev/null @@ -1,96 +0,0 @@ -- - 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 - probability: 0.0 - 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 - day_open: 0.0 - name: Test Lead1 - planned_revenue: 0.0 - probability: 10.0 - section_id: crm.section_sales_department -- - I open the lead. -- - !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 percent. -- - !python {model: crm.lead}: | - self.stage_find_percent(cr, uid, 10.0, []) -- - I find that this lead can be converted to opportunity. -- - !record {model: crm.lead2opportunity.partner, id: crm_lead2opportunity_partner0}: - action: 'create' - name: 'convert' -- - So I convert the lead to opportunity. -- - !python {model: crm.lead2opportunity.partner}: | - self.action_apply(cr, uid, [ref('crm_lead2opportunity_partner0')], context={'active_ids': [ref('crm_lead_openerppresentation0')]}) -- - I check that lead is now converted to opportunity. -- - !python {model: crm.lead}: | - lead = self.browse(cr, uid, ref('crm_lead_openerppresentation0')) - assert lead.type == 'opportunity', 'Lead is not converted to opportunity!' -- - I mark this opportunity as lost. -- - !python {model: crm.lead}: | - self.case_mark_lost(cr, uid, [ref('crm_lead_openerppresentation0')]) -- - 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')) - assert opportunity.stage_id.id == ref('crm.stage_lead6'), 'Stage is not changed!' - assert opportunity.probability == 0.0, 'Probability is wrong!' -- - I create one more opportunity. -- - !record {model: crm.lead, id: crm_lead_test2}: - name: Partner Demo - type: opportunity - categ_id: crm.categ_oppor3 - planned_revenue: 50000.0 - probability: 100.0 - section_id: crm.section_sales_department -- - I open this opportunity. -- - !python {model: crm.lead}: | - self.case_open(cr, uid, [ref('crm_lead_test2')]) -- - I mark this opportunity as won. -- - !python {model: crm.lead}: | - self.case_mark_won(cr, uid, [ref('crm_lead_test2')]) -- - I check whether the stage is changed to 'Won' and probability is 100.0 or not. -- - !python {model: crm.lead}: | - opportunity = self.browse(cr, uid, ref('crm_lead_test2')) - assert opportunity.stage_id.id == ref('crm.stage_lead5'), 'Stage is not changed!' - assert opportunity.probability == 100.0, 'Probability is wrong!' From 7c8c006beb6fe137035edaa933b85a8903b02bca Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Fri, 14 Oct 2011 16:17:29 +0530 Subject: [PATCH 034/132] [IMP]: crm: Added internal note after wining the opportunity in lead2opportunity.yml bzr revid: ron@tinyerp.com-20111014104729-1la21n3mxpzb0qz7 --- addons/crm/test/process/lead2opportunity.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/addons/crm/test/process/lead2opportunity.yml b/addons/crm/test/process/lead2opportunity.yml index 108a0a74dbf..bb6ecef5327 100644 --- a/addons/crm/test/process/lead2opportunity.yml +++ b/addons/crm/test/process/lead2opportunity.yml @@ -35,6 +35,23 @@ - !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: stage of opportunity is win}: - stage_id.name == "Won" +- + I want to add internal note to this opportunity, so i create note. +- + !record {model: crm.add.note, id: crm_add_note_won_opportunity}: + body: 'I won this Opportunity' +- + Apply this note to opportunity. +- + !python {model: crm.add.note}: | + self.action_add(cr, uid, [ref("crm_add_note_won_opportunity")], {"active_model": "crm.lead","active_ids": [ref("crm_case_qrecorp0")]}) +- + I will test Internal note added on opportunity . +- + !python {model: crm.lead}: | + lead = self.browse(cr, uid, ref('crm_case_qrecorp0')) + message = 'I won this Opportunity' in lead.message_ids[-1].subject + assert message,'Fail to Added interal note on opportunity' - After winning the opportunity, i will test probability is 100. - From f1c236c3aed7732a685e03a7c042f72b6b839641 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Fri, 14 Oct 2011 16:22:56 +0530 Subject: [PATCH 035/132] [REF]: crm: Removed code of cheking probability and planned_revenue in lead2opportunity.yml bzr revid: ron@tinyerp.com-20111014105256-anhbcrgqvtpgm1n6 --- addons/crm/test/process/lead2opportunity.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/addons/crm/test/process/lead2opportunity.yml b/addons/crm/test/process/lead2opportunity.yml index bb6ecef5327..b09ed397fe0 100644 --- a/addons/crm/test/process/lead2opportunity.yml +++ b/addons/crm/test/process/lead2opportunity.yml @@ -16,8 +16,6 @@ !python {model: crm.lead}: | lead = self.browse(cr, uid, ref('crm_case_qrecorp0')) assert lead.type == 'opportunity', 'Lead is not converted to opportunity!' - assert lead.planned_revenue == 0.0, 'Planned revenue should be 0!' - assert lead.probability == 0.0, 'probability revenue should be 0!' assert lead.partner_id.id == ref("base.res_partner_agrolait"), 'Partner missmatch!' assert lead.stage_id.id == ref("stage_lead1"), 'Stage of probability is incorrect!' - From 12c7d62a53f1b561f105900ff7cc810473eae0c7 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Fri, 14 Oct 2011 16:45:44 +0530 Subject: [PATCH 036/132] [REM]: crm: Removed test_crm_recurrent_meeting.yml because its have only demo data created bzr revid: ron@tinyerp.com-20111014111544-shi3hshjja7yxpw5 --- addons/crm/__openerp__.py | 1 - .../crm/test/test_crm_recurrent_meeting.yml | 106 ------------------ 2 files changed, 107 deletions(-) delete mode 100644 addons/crm/test/test_crm_recurrent_meeting.yml diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index fdd841c2534..2ad30af3c85 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -126,7 +126,6 @@ Creates a dashboard for CRM that includes: 'test/process/lead2_mass_convert_opportunity.yml', 'test/ui/lead_form.yml', 'test/process/phonecall2opportunity.yml', - 'test/test_crm_recurrent_meeting.yml', 'test/test_crm_recurrent_meeting_case2.yml', 'test/test_crm_segmentation.yml', ], diff --git a/addons/crm/test/test_crm_recurrent_meeting.yml b/addons/crm/test/test_crm_recurrent_meeting.yml deleted file mode 100644 index 297ca8d5e4e..00000000000 --- a/addons/crm/test/test_crm_recurrent_meeting.yml +++ /dev/null @@ -1,106 +0,0 @@ -- - In order to test recurrent meetings in OpenERP, I create meetings with different recurrency. -- - I create a customer meeting record with daily recurrency. -- - !record {model: crm.meeting, id: crm_meeting_pricelistdiscussion0}: - categ_id: crm.categ_meet1 - count: 0.0 - date: '2011-01-05 00:00:00' - date_deadline: '2011-01-05 01:00:00' - day: 0.0 - duration: 1.0 - end_date: '2011-01-12' - end_type: end_date - name: Pricelist Discussion - recurrency: true - recurrent_uid: 0.0 - rrule: FREQ=DAILY;INTERVAL=1;UNTIL=20110112T235959Z - rrule_type: daily - sequence: 0.0 -- - I create another meeting record with weekly recurrency. -- - !record {model: crm.meeting, id: crm_meeting_changesindesigning0}: - categ_id: crm.categ_meet2 - count: 15 - date: '2011-01-22 11:05:05' - date_deadline: '2011-01-22 16:05:05' - day: 0.0 - duration: 5.0 - email_from: info@opensides.be - end_type: count - fr: true - mo: true - name: Changes in Designing - partner_address_id: base.res_partner_address_1 - partner_id: base.res_partner_9 - recurrency: true - recurrent_uid: 0.0 - rrule: FREQ=WEEKLY;BYDAY=FR,TU,TH,WE,MO;INTERVAL=1;COUNT=15 - rrule_type: weekly - section_id: crm.section_sales_department - sequence: 0.0 - th: true - tu: true - user_id: base.user_demo - we: true -- - I create a meeting record with monthly recurrency. -- - !record {model: crm.meeting, id: crm_meeting_reviewneeds0}: - categ_id: crm.categ_meet3 - count: 0.0 - date: '2011-01-20 10:02:02' - date_deadline: '2011-01-20 16:02:02' - day: 15 - duration: 6.0 - end_date: '2011-05-31' - end_type: end_date - name: Review needs - partner_address_id: base.res_partner_address_15 - partner_id: base.res_partner_11 - recurrency: true - recurrent_uid: 0.0 - rrule: FREQ=MONTHLY;INTERVAL=1;UNTIL=20110531T235959Z;BYMONTHDAY=15 - rrule_type: monthly - section_id: crm.section_sales_department - sequence: 0.0 - user_id: base.user_demo -- - I create a record for daily scrum meeting. -- - !record {model: crm.meeting, id: crm_meeting_scrummeeting0}: - categ_id: crm.categ_meet2 - count: 0.0 - date: '2011-01-06 00:00:00' - date_deadline: '2011-01-06 01:00:00' - day: 0.0 - duration: 1.0 - name: Scrum meeting - recurrency: true - recurrent_uid: 0.0 - rrule: FREQ=DAILY;INTERVAL=1 - rrule_type: daily - sequence: 0.0 -- - I create a meeting record for yearly recurrency. -- - !record {model: crm.meeting, id: crm_meeting_updatethedata0}: - categ_id: crm.categ_meet2 - count: 0.0 - date: '2011-01-18 13:12:49' - date_deadline: '2011-01-19 02:30:49' - day: 0.0 - duration: 13.300000000000001 - end_date: '2015-01-06' - end_type: end_date - name: Update the data - partner_address_id: base.res_partner_address_7 - partner_id: base.res_partner_4 - recurrency: true - recurrent_uid: 0.0 - rrule: FREQ=YEARLY;INTERVAL=1;UNTIL=20150106T235959Z - rrule_type: yearly - section_id: crm.section_sales_department - sequence: 0.0 From 0625ab16fc4f46e70b226f908e1064a79e15804f Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Fri, 14 Oct 2011 17:26:12 +0530 Subject: [PATCH 037/132] [REF, MV]: Todo code in lead2opportunity.yml and move test_crm_segmentation.yml to crm_profile bzr revid: ron@tinyerp.com-20111014115612-wze2p8dcnh6gvopg --- addons/crm/__openerp__.py | 1 - addons/crm/test/process/lead2opportunity.yml | 17 +++++++++-------- addons/crm_profiling/__openerp__.py | 3 ++- .../test/test_crm_segmentation.yml | 0 4 files changed, 11 insertions(+), 10 deletions(-) rename addons/{crm => crm_profiling}/test/test_crm_segmentation.yml (100%) diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index 2ad30af3c85..9c45d9237b6 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -127,7 +127,6 @@ Creates a dashboard for CRM that includes: 'test/ui/lead_form.yml', 'test/process/phonecall2opportunity.yml', 'test/test_crm_recurrent_meeting_case2.yml', - 'test/test_crm_segmentation.yml', ], 'installable': True, 'active': False, diff --git a/addons/crm/test/process/lead2opportunity.yml b/addons/crm/test/process/lead2opportunity.yml index b09ed397fe0..ef8d20fc602 100644 --- a/addons/crm/test/process/lead2opportunity.yml +++ b/addons/crm/test/process/lead2opportunity.yml @@ -34,7 +34,7 @@ !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: stage of opportunity is win}: - stage_id.name == "Won" - - I want to add internal note to this opportunity, so i create note. + I add internal note to this opportunity, so i create note. - !record {model: crm.add.note, id: crm_add_note_won_opportunity}: body: 'I won this Opportunity' @@ -43,13 +43,14 @@ - !python {model: crm.add.note}: | self.action_add(cr, uid, [ref("crm_add_note_won_opportunity")], {"active_model": "crm.lead","active_ids": [ref("crm_case_qrecorp0")]}) -- - I will test Internal note added on opportunity . -- - !python {model: crm.lead}: | - lead = self.browse(cr, uid, ref('crm_case_qrecorp0')) - message = 'I won this Opportunity' in lead.message_ids[-1].subject - assert message,'Fail to Added interal note on opportunity' + +# TODO: cheked For ordering of history of message +#- +# I test Internal latest note added on opportunity . +#- +# !python {model: crm.lead}: | +# lead = self.browse(cr, uid, ref('crm_case_qrecorp0')) +# assert lead.message_ids[0].subject == 'I won this Opportunity', 'Fail to Added interal note on opportunity' - After winning the opportunity, i will test probability is 100. - diff --git a/addons/crm_profiling/__openerp__.py b/addons/crm_profiling/__openerp__.py index 656f8360f0b..71b4e2f126e 100644 --- a/addons/crm_profiling/__openerp__.py +++ b/addons/crm_profiling/__openerp__.py @@ -41,7 +41,8 @@ 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'], + 'test': ['test/test_crm_profiling.yml', + 'test/test_crm_segmentation.yml',], 'installable': True, 'active': False, 'certificate': '0033984979005', diff --git a/addons/crm/test/test_crm_segmentation.yml b/addons/crm_profiling/test/test_crm_segmentation.yml similarity index 100% rename from addons/crm/test/test_crm_segmentation.yml rename to addons/crm_profiling/test/test_crm_segmentation.yml From c656f53e81f7940bfd7cfc80d62d667ed5d57de0 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Mon, 17 Oct 2011 15:16:17 +0530 Subject: [PATCH 038/132] [ADD] crm: 1) Added yml partner2opportunity.yml, 2) Covered partner to opportunity scenario bzr revid: ron@tinyerp.com-20111017094617-9ctr8c7liedjo2fh --- addons/crm/__openerp__.py | 1 + .../crm/test/process/partner2opportunity.yml | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 addons/crm/test/process/partner2opportunity.yml diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index 9c45d9237b6..b1fdfd3ff62 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -121,6 +121,7 @@ Creates a dashboard for CRM that includes: 'test': [ 'test/process/lead_open.yml', 'test/process/lead2opportunity.yml', + 'test/process/partner2opportunity.yml', 'test/process/cancel_lead.yml', 'test/process/meeting.yml', 'test/process/lead2_mass_convert_opportunity.yml', diff --git a/addons/crm/test/process/partner2opportunity.yml b/addons/crm/test/process/partner2opportunity.yml new file mode 100644 index 00000000000..542056f0f9b --- /dev/null +++ b/addons/crm/test/process/partner2opportunity.yml @@ -0,0 +1,20 @@ +- | + I will create opportunity by partner. +- + !record {model: crm.partner2opportunity, id: crm_partner2opportunity_id_0}: + name: BalmerInc S.A. + planned_revenue: 200.0 + partner_id: base.res_partner_9 + probability: 150.0 + +- + Convert partner to opportunity, i will test to convert opportunity is correct. +- + !python {model: crm.partner2opportunity}: | + opportunity = self.make_opportunity(cr, uid, [ref("crm_partner2opportunity_id_0")]) + opportunity_rec = self.pool.get('crm.lead').browse(cr, uid, opportunity['res_id']) + assert opportunity_rec.type == 'opportunity', 'Lead is not converted to opportunity!' + assert opportunity_rec.planned_revenue == 200.0, 'Planned revenue should be 200!' + assert opportunity_rec.probability == 150.0, 'probability revenue should be 150!' + assert opportunity_rec.partner_id.id == ref("base.res_partner_9"), 'Partner missmatch!' + assert opportunity_rec.state == 'draft', 'Opportunity stage not in draft state' From b147d8a4c113530430d1e8ae77d89209ec8a3952 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Mon, 17 Oct 2011 15:19:55 +0530 Subject: [PATCH 039/132] [ADD] crm: Added phonecall2meeting.yml bzr revid: ron@tinyerp.com-20111017094955-dgeazzmitmq3jf4v --- addons/crm/__openerp__.py | 1 + addons/crm/test/process/phonecall2meeting.yml | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 addons/crm/test/process/phonecall2meeting.yml diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index b1fdfd3ff62..853c9f85568 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -127,6 +127,7 @@ Creates a dashboard for CRM that includes: 'test/process/lead2_mass_convert_opportunity.yml', 'test/ui/lead_form.yml', 'test/process/phonecall2opportunity.yml', + 'test/process/phonecall2meeting.yml', 'test/test_crm_recurrent_meeting_case2.yml', ], 'installable': True, diff --git a/addons/crm/test/process/phonecall2meeting.yml b/addons/crm/test/process/phonecall2meeting.yml new file mode 100644 index 00000000000..c0579157494 --- /dev/null +++ b/addons/crm/test/process/phonecall2meeting.yml @@ -0,0 +1,6 @@ +- + I test to arrage meeting from Phonecall, so i convert and check phonecall to meeting. +- + !python {model: crm.phonecall}: | + res = self.action_make_meeting(cr, uid, [ref('crm_case_phone06')]) + assert res, "No create Meeting from phonecall" From 1fa0e18c2b72f98d202307644338cccbe76ef6c5 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Mon, 17 Oct 2011 15:26:01 +0530 Subject: [PATCH 040/132] [MOVE] crm, base_calander: Move test_crm_recurrent_meeting_case2.yml to base_calender bzr revid: ron@tinyerp.com-20111017095601-akmk2nmkn955inbi --- .../test/test_crm_recurrent_meeting_case2.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename addons/{crm => base_calendar}/test/test_crm_recurrent_meeting_case2.yml (100%) diff --git a/addons/crm/test/test_crm_recurrent_meeting_case2.yml b/addons/base_calendar/test/test_crm_recurrent_meeting_case2.yml similarity index 100% rename from addons/crm/test/test_crm_recurrent_meeting_case2.yml rename to addons/base_calendar/test/test_crm_recurrent_meeting_case2.yml From 87727d9b541bd54fbd5bb87681a7d215d4764ea1 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Mon, 17 Oct 2011 15:28:12 +0530 Subject: [PATCH 041/132] [IMP] crm: delete from __openerp__.py, test_crm_recurrent_meeting_case2.yml bzr revid: ron@tinyerp.com-20111017095812-ybn537b37hap94sg --- addons/crm/__openerp__.py | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index 853c9f85568..49fc12f9747 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -128,7 +128,6 @@ Creates a dashboard for CRM that includes: 'test/ui/lead_form.yml', 'test/process/phonecall2opportunity.yml', 'test/process/phonecall2meeting.yml', - 'test/test_crm_recurrent_meeting_case2.yml', ], 'installable': True, 'active': False, From dc95f95342cf360e74ae9332cc5b0b52dd045a83 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Mon, 17 Oct 2011 16:55:25 +0530 Subject: [PATCH 042/132] [ADD] crm: 1) Added schedule_other_phonecall.yml, 2) checked schedule call created bzr revid: ron@tinyerp.com-20111017112525-8fhqb8iuclh9hdkp --- addons/crm/__openerp__.py | 1 + .../test/process/schedule_other_phonecall.yml | 23 +++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 addons/crm/test/process/schedule_other_phonecall.yml diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index 49fc12f9747..cbcaa774c05 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -128,6 +128,7 @@ Creates a dashboard for CRM that includes: 'test/ui/lead_form.yml', 'test/process/phonecall2opportunity.yml', 'test/process/phonecall2meeting.yml', + 'test/process/schedule_other_phonecall.yml' ], 'installable': True, 'active': False, diff --git a/addons/crm/test/process/schedule_other_phonecall.yml b/addons/crm/test/process/schedule_other_phonecall.yml new file mode 100644 index 00000000000..a92496dc265 --- /dev/null +++ b/addons/crm/test/process/schedule_other_phonecall.yml @@ -0,0 +1,23 @@ +- + I schedule phonecall to another phonecall, so first i create record of schedule call. +- + !record {model: crm.phonecall2phonecall, id: crm_schedule_phonecall}: + name: 'Test Discuss Review Process' + categ_id: crm.categ_phone1 + date: !eval time.strftime('%Y-%m-%d') +- + I Convert schedule phonecall. +- + !python {model: crm.phonecall2phonecall}: | + self.action_apply(cr, uid, [ref('crm_schedule_phonecall')], {'active_id': ref('crm_case_phone04')}) +- + I check for another schedule call. +- + !python {model: crm.phonecall}: | + phonecall = self.search(cr, uid, [('name', '=', 'Test Discuss Review Process')]) + assert phonecall, "Do not create another schedule call" + schedule_phonecall = self.browse(cr, uid, phonecall)[0] + assert schedule_phonecall.user_id.id == ref("base.user_root"), "Responsible person not assign" + assert schedule_phonecall.section_id.id == ref("crm.section_sales_department"), "Do not assign proper section" + assert schedule_phonecall.categ_id.id == ref("crm.categ_phone1"), "Category of phonecall is not apply" + assert schedule_phonecall.partner_id.id == ref("base.res_partner_tinyatwork"), "Partner missmatch" \ No newline at end of file From 3f26dce9f8ec2fc80adb1b9d424a734318140af1 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Mon, 17 Oct 2011 18:06:01 +0530 Subject: [PATCH 043/132] [IMP, REF] crm: 1) Renamed lead2opportunity.yml to lead2opportunity_win_lost.yml, 2) Removed code of Merge2opportunity 3)Improved string bzr revid: ron@tinyerp.com-20111017123601-vnyfiekpupjkxgf1 --- addons/crm/__openerp__.py | 2 +- ...nity.yml => lead2opportunity_win_lost.yml} | 32 ++++--------------- 2 files changed, 7 insertions(+), 27 deletions(-) rename addons/crm/test/process/{lead2opportunity.yml => lead2opportunity_win_lost.yml} (68%) diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index cbcaa774c05..7b11d12cede 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -120,7 +120,7 @@ Creates a dashboard for CRM that includes: ], 'test': [ 'test/process/lead_open.yml', - 'test/process/lead2opportunity.yml', + 'test/process/lead2opportunity_win_lost.yml', 'test/process/partner2opportunity.yml', 'test/process/cancel_lead.yml', 'test/process/meeting.yml', diff --git a/addons/crm/test/process/lead2opportunity.yml b/addons/crm/test/process/lead2opportunity_win_lost.yml similarity index 68% rename from addons/crm/test/process/lead2opportunity.yml rename to addons/crm/test/process/lead2opportunity_win_lost.yml index ef8d20fc602..e5103c48ef0 100644 --- a/addons/crm/test/process/lead2opportunity.yml +++ b/addons/crm/test/process/lead2opportunity_win_lost.yml @@ -1,17 +1,16 @@ - - As the lead seems to be a real business opportunity, I will convert it to a partner - and a business opportunity. + I test to convert lead to real business opportunity, so first i create existing partner attached with lead. - !record {model: crm.lead2opportunity.partner, id: crm_lead2opportunity_partner_create_1}: action: 'exist' partner_id: base.res_partner_agrolait - - Create opportunity based on exiting partner + Create opportunity based on exiting partner. - !python {model: crm.lead2opportunity.partner}: | self.action_apply(cr, uid, [ref("crm_lead2opportunity_partner_create_1")], {'active_ids': [ref("crm_case_qrecorp0")], 'active_id': ref("crm_case_qrecorp0")}) - - In order to test lead, i will test to lead is converted to opportunity. + After converted in opportunity, i test to lead is converted to opportunity. - !python {model: crm.lead}: | lead = self.browse(cr, uid, ref('crm_case_qrecorp0')) @@ -19,12 +18,12 @@ assert lead.partner_id.id == ref("base.res_partner_agrolait"), 'Partner missmatch!' assert lead.stage_id.id == ref("stage_lead1"), 'Stage of probability is incorrect!' - - Finally, i won this opportunity, so i will close this lead. + Finally, i won this opportunity, so i close this opportunity. - !python {model: crm.lead}: | self.case_mark_won(cr, uid, [ref("crm_case_qrecorp0")]) - - In order to test opportunity, it is close or not. + I check lead is close or not. - !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: Lead in done state}: - state == "done" @@ -52,7 +51,7 @@ # lead = self.browse(cr, uid, ref('crm_case_qrecorp0')) # assert lead.message_ids[0].subject == 'I won this Opportunity', 'Fail to Added interal note on opportunity' - - After winning the opportunity, i will test probability is 100. + After winning the opportunity, i test probability is 100. - !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: Probability is equal to 100}: - probability == 100.0 @@ -69,22 +68,3 @@ opportunity = self.browse(cr, uid, ref('crm_case_rdroundfundingunits0')) assert opportunity.stage_id.id == ref('crm.stage_lead6'), 'Stage is not changed!' assert opportunity.probability == 0.0, 'Probability is wrong!' - -- - I have two opportunity ,so i will merge this two Opportunities. -- - !python {model: crm.merge.opportunity}: | - op_ids=self.pool.get('crm.lead').browse(cr, uid, [ref('crm_case_bankwealthy2'), ref('crm_case_unifliege')]) - self.merge(cr, uid, op_ids) - -- - I will test which two opportunity merged . -- - !python {model: crm.lead}: | - lead = self.browse(cr, uid, ref('crm_case_bankwealthy2')) - merge = 'Merged opportunities' in lead.message_ids[0].subject - assert merge,'Fail to create Merge opportunity' - assert lead.type == 'opportunity', 'Merged opportunity type not change!' - assert lead.partner_id.id == ref("base.res_partner_accent"), 'Partner missmatch!' - assert lead.stage_id.id == ref("stage_lead2"), 'Stage of probability is incorrect!' - \ No newline at end of file From 4ffbf5fc8583e04852a69ab4f61b487f6e1e6848 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Mon, 17 Oct 2011 18:14:33 +0530 Subject: [PATCH 044/132] [ADD] crm: Added new yml merge_opportunity.yml and also updated __openerp__.py bzr revid: ron@tinyerp.com-20111017124433-21wwyc3yvs4qs2ca --- addons/crm/__openerp__.py | 1 + addons/crm/test/process/merge_opportunity.yml | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 addons/crm/test/process/merge_opportunity.yml diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index 7b11d12cede..965222976aa 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -121,6 +121,7 @@ Creates a dashboard for CRM that includes: 'test': [ 'test/process/lead_open.yml', 'test/process/lead2opportunity_win_lost.yml', + 'test/process/merge_opportunity.yml', 'test/process/partner2opportunity.yml', 'test/process/cancel_lead.yml', 'test/process/meeting.yml', diff --git a/addons/crm/test/process/merge_opportunity.yml b/addons/crm/test/process/merge_opportunity.yml new file mode 100644 index 00000000000..2028c304276 --- /dev/null +++ b/addons/crm/test/process/merge_opportunity.yml @@ -0,0 +1,17 @@ +- + I have two opportunity ,so i merge this two Opportunities. +- + !python {model: crm.merge.opportunity}: | + op_ids=self.pool.get('crm.lead').browse(cr, uid, [ref('crm_case_bankwealthy2'), ref('crm_case_unifliege')]) + self.merge(cr, uid, op_ids) + +- + I test which two opportunity has been merged . +- + !python {model: crm.lead}: | + lead = self.browse(cr, uid, ref('crm_case_bankwealthy2')) + merge = 'Merged opportunities' in lead.message_ids[0].subject + assert merge,'Fail to create Merge opportunity' + assert lead.type == 'opportunity', 'Merged opportunity type not change!' + assert lead.partner_id.id == ref("base.res_partner_accent"), 'Partner missmatch!' + assert lead.stage_id.id == ref("stage_lead2"), 'Stage of probability is incorrect!' From 845828efe96014453542819003a377882b7a38a5 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Mon, 17 Oct 2011 18:22:34 +0530 Subject: [PATCH 045/132] [IMP, REF] crm: 1) Renamed lead2_mass_convert_opportunity.yml to mass_leads2opportunity.yml, 2) Improved string value, 3) Updated __openerp__.py bzr revid: ron@tinyerp.com-20111017125234-6clvbte3zc7l0ivf --- addons/crm/__openerp__.py | 2 +- ...ss_convert_opportunity.yml => mass_leads2opportunity.yml} | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) rename addons/crm/test/process/{lead2_mass_convert_opportunity.yml => mass_leads2opportunity.yml} (90%) diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index 965222976aa..66115e97e30 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -125,7 +125,7 @@ Creates a dashboard for CRM that includes: 'test/process/partner2opportunity.yml', 'test/process/cancel_lead.yml', 'test/process/meeting.yml', - 'test/process/lead2_mass_convert_opportunity.yml', + 'test/process/mass_leads2opportunity.yml', 'test/ui/lead_form.yml', 'test/process/phonecall2opportunity.yml', 'test/process/phonecall2meeting.yml', diff --git a/addons/crm/test/process/lead2_mass_convert_opportunity.yml b/addons/crm/test/process/mass_leads2opportunity.yml similarity index 90% rename from addons/crm/test/process/lead2_mass_convert_opportunity.yml rename to addons/crm/test/process/mass_leads2opportunity.yml index 22c22d7a376..4286eac1848 100644 --- a/addons/crm/test/process/lead2_mass_convert_opportunity.yml +++ b/addons/crm/test/process/mass_leads2opportunity.yml @@ -1,12 +1,13 @@ - - Using mass wizard, convert two lead to opportunity. + Using mass wizard convert two lead to opportunity ,so first i create mass record for + converting in opportunity. - !record {model: crm.lead2opportunity.partner.mass, id: crm_lead2opportunity_partner_mass0}: user_ids: - base.user_root section_id: crm.section_sales_department - - Leads coverts to mass opportunity. + Convert mass Leads to opportunity. - !python {model: crm.lead2opportunity.partner.mass}: | self.mass_convert(cr, uid, [ref("crm_lead2opportunity_partner_mass0")],{'active_ids': [ref("crm_case_employee0"), ref("crm_case_electonicgoodsdealer0")], 'active_id': ref("crm_case_qrecorp0")}) From d756ccfb55bf349096029c6b7bf2fed094f6f99f Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Mon, 17 Oct 2011 18:36:51 +0530 Subject: [PATCH 046/132] [IMP, REF] crm: 1) Renamed lead_open.yml to draft2open_lead.yml, 2) Improved string value, 3) Updated __openerp__.py bzr revid: ron@tinyerp.com-20111017130651-kbsl9j33jui7at98 --- addons/crm/__openerp__.py | 2 +- .../crm/test/process/{lead_open.yml => draft2open_lead.yml} | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) rename addons/crm/test/process/{lead_open.yml => draft2open_lead.yml} (54%) diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index 66115e97e30..b7d4332d319 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -119,7 +119,7 @@ Creates a dashboard for CRM that includes: 'crm_phonecall_demo.xml', ], 'test': [ - 'test/process/lead_open.yml', + 'test/process/draft2open_lead.yml', 'test/process/lead2opportunity_win_lost.yml', 'test/process/merge_opportunity.yml', 'test/process/partner2opportunity.yml', diff --git a/addons/crm/test/process/lead_open.yml b/addons/crm/test/process/draft2open_lead.yml similarity index 54% rename from addons/crm/test/process/lead_open.yml rename to addons/crm/test/process/draft2open_lead.yml index d5c6bb2d101..97947b5846b 100644 --- a/addons/crm/test/process/lead_open.yml +++ b/addons/crm/test/process/draft2open_lead.yml @@ -1,10 +1,10 @@ - - Communication by phonecall or mail I got lead from Customer/partner, I test to created lead in initial stage. + I got lead from Customer, I open this lead. - !python {model: crm.lead}: | self.case_open(cr, uid, [ref("crm_case_qrecorp0")]) - | - In order to test lead, i will test lead is in open stage. + In order to test lead, i test lead is in open stage. - !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: Lead in open state}: - state == "open" From a5e50a5a272bcadd8b4d092152113cd8486b99c5 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Tue, 18 Oct 2011 10:30:09 +0530 Subject: [PATCH 047/132] [IMP] crm: Improved string on cancel_lead.yml bzr revid: ron@tinyerp.com-20111018050009-drdg39ws1w9gnj5d --- addons/crm/test/process/cancel_lead.yml | 32 ++++++++++++------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/addons/crm/test/process/cancel_lead.yml b/addons/crm/test/process/cancel_lead.yml index 3a3366c05e4..abd966b5e9d 100644 --- a/addons/crm/test/process/cancel_lead.yml +++ b/addons/crm/test/process/cancel_lead.yml @@ -1,45 +1,45 @@ - - Cheking for lead from draft to cancel, I will cancelling this lead. + Cheking for lead from draft to cancel, I cancel this lead. - !python {model: crm.lead}: | self.case_cancel(cr, uid, [ref("crm_case_itisatelesalescampaign0")]) - - In order to test for cancel lead , i will test lead is on cancel state. + I test lead is on cancel state. - !assert {model: crm.lead, id: crm.crm_case_itisatelesalescampaign0, string: Lead is in cancel state}: - state == "cancel" - - Cheking for lead from cancel to reset, I will reseting this lead. + Checking for lead from cancel to reset, I reset this lead. - !python {model: crm.lead}: | self.case_reset(cr, uid, [ref("crm_case_itisatelesalescampaign0")]) - - In order to test for reset lead , i will test lead is on draft state. + I test lead is on draft state. - !assert {model: crm.lead, id: crm.crm_case_itisatelesalescampaign0, string: Lead is in draft state}: - state == "draft" - - Cheking for lead from reset to pending, I will pending this lead. + Cheking for lead from reset to pending, I pending this lead. - !python {model: crm.lead}: | self.case_pending(cr, uid, [ref("crm_case_itisatelesalescampaign0")]) - - In order to test for pending lead , i will test lead is on pending state. + I test lead is on pending state. - !assert {model: crm.lead, id: crm.crm_case_itisatelesalescampaign0, string: Lead is in pending state}: - state == "pending" - - Cheking for lead from pending to cancel, I will cancelling this lead. + Cheking for lead from pending to cancel, I cancel this lead. - !python {model: crm.lead}: | self.case_cancel(cr, uid, [ref("crm_case_itisatelesalescampaign0")]) - - In order to test for cancel lead , i will test lead is on cancel state. + I test lead is on cancel state. - !assert {model: crm.lead, id: crm.crm_case_itisatelesalescampaign0, string: Lead is in cancel state}: - state == "cancel" - - For working on parent child relationship, we are creating sales executive department that will be work under + For working on parent child relationship, I create sales executive department that will be work under Sales Department. - !record {model: crm.case.section, id: section_sales_exe_department}: @@ -47,31 +47,31 @@ parent_id: crm.section_sales_department - - If Lead not handle by executive team so its need to Escalate lead from sales executive department to sales department, - for that purpose i Assign sales executive department on lead, after we will be process to escalate lead to sales department + Escalate lead from sales executive department to sales department, + for that purpose i assign sales executive department on lead, + after i will be process to escalate lead to sales department - !record {model: crm.lead, id: crm.crm_case_itisatelesalescampaign0}: section_id: section_sales_exe_department - - Processing on Lead escalate to sales Departemnt, we are checking for lead Escalate to sales Department from Executive + Processing on Lead escalate to sales departemnt, i check for lead escalate to sales Department from Executive department or not. - !python {model: crm.lead}: | self.case_reset(cr, uid, [ref("crm_case_itisatelesalescampaign0")]) self.case_escalate(cr, uid, [ref("crm_case_itisatelesalescampaign0")]) - - In order to test for escalate lead , i will test lead Escalate from sales Department from Executive - department. + I test lead escalate from sales department from Executive department. - !assert {model: crm.lead, id: crm.crm_case_itisatelesalescampaign0, string: Escalate lead to on sales team from Executive teame}: - section_id.name == "Sales Department" - - Cheking for lead from escalate to cancel, I will cancelling this lead. + Cheking for lead from escalate to cancel, I cancel this lead. - !python {model: crm.lead}: | self.case_cancel(cr, uid, [ref("crm_case_itisatelesalescampaign0")]) - - In order to test for cancel lead , i will test lead is on cancel state. + I test lead is on cancel state. - !assert {model: crm.lead, id: crm.crm_case_itisatelesalescampaign0, string: Lead is in cancel state}: - state == "cancel" From d61ea7b209e023681ae1a78cf818a15af8af31a1 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Tue, 18 Oct 2011 10:32:08 +0530 Subject: [PATCH 048/132] [IMP] crm: removed one string on cancel_lead.yml bzr revid: ron@tinyerp.com-20111018050208-jocyosbhswo08gw5 --- addons/crm/test/process/cancel_lead.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/crm/test/process/cancel_lead.yml b/addons/crm/test/process/cancel_lead.yml index abd966b5e9d..75afa71c1d9 100644 --- a/addons/crm/test/process/cancel_lead.yml +++ b/addons/crm/test/process/cancel_lead.yml @@ -39,8 +39,7 @@ !assert {model: crm.lead, id: crm.crm_case_itisatelesalescampaign0, string: Lead is in cancel state}: - state == "cancel" - - For working on parent child relationship, I create sales executive department that will be work under - Sales Department. + I create sales executive department that will be work under Sales Department. - !record {model: crm.case.section, id: section_sales_exe_department}: name: "Sales Executive" From f43ab4b01e35945bccd04302d57a4113d76d3939 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Tue, 18 Oct 2011 10:37:16 +0530 Subject: [PATCH 049/132] [IMP] crm: Improved string on lead_form.yml(onchange event, copy and unlink the record) bzr revid: ron@tinyerp.com-20111018050716-xn8015acnwwvitb4 --- addons/crm/test/ui/lead_form.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/crm/test/ui/lead_form.yml b/addons/crm/test/ui/lead_form.yml index c6cbbb3fcb2..8cfc96283b0 100644 --- a/addons/crm/test/ui/lead_form.yml +++ b/addons/crm/test/ui/lead_form.yml @@ -1,18 +1,18 @@ - - In order to check for changes on partner, data will be change automatically according to partner, + In order to check for changes on partner, country and phone number change automatically according to partner, - !python {model: crm.lead}: | action = self.onchange_partner_address_id(cr, uid, ref("crm_case_qrecorp0"), ref("base.res_partner_address_notsotinysarl0"), email=False) assert action['value']['country_id'] == 20, "Country name not True" assert action['value']['phone'] == '(+32).81.81.37.00', "phone number is wrong" - - I try to Unlink the Lead I create new record of lead. + I try to Unlink the lead, so I create new record of lead on cancel stage. - !record {model: crm.lead, id: crm_case_new_lead}: name: Openerp Trainning state: cancel - - In order to test unlink lead, i will do unlink this lead + I test copy and unlink this lead. - !python {model: crm.lead}: | self.copy(cr, uid, ref("crm_case_new_lead")) From faea3fa2130fa2cb7f178d986add1606fe580809 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Tue, 18 Oct 2011 10:46:39 +0530 Subject: [PATCH 050/132] [IMP] crm: Improved string on lead2opportunity_win_lost.yml bzr revid: ron@tinyerp.com-20111018051639-kdy5pvaqeg3witvr --- addons/crm/test/process/lead2opportunity_win_lost.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/crm/test/process/lead2opportunity_win_lost.yml b/addons/crm/test/process/lead2opportunity_win_lost.yml index e5103c48ef0..eacb919c3eb 100644 --- a/addons/crm/test/process/lead2opportunity_win_lost.yml +++ b/addons/crm/test/process/lead2opportunity_win_lost.yml @@ -16,16 +16,16 @@ lead = self.browse(cr, uid, ref('crm_case_qrecorp0')) assert lead.type == 'opportunity', 'Lead is not converted to opportunity!' assert lead.partner_id.id == ref("base.res_partner_agrolait"), 'Partner missmatch!' - assert lead.stage_id.id == ref("stage_lead1"), 'Stage of probability is incorrect!' + assert lead.stage_id.id == ref("stage_lead1"), 'Stage of opportunity is incorrect!' - Finally, i won this opportunity, so i close this opportunity. - !python {model: crm.lead}: | self.case_mark_won(cr, uid, [ref("crm_case_qrecorp0")]) - - I check lead is close or not. + I check opportunity is close or not. - - !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: Lead in done state}: + !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: Opportunity in done state}: - state == "done" - In order to test stage of opportunity after win, i will test stage of opportunity. From a1ab9fdfe6aca1faba3a0919ca2014eb4eaf6fa1 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Tue, 18 Oct 2011 11:00:37 +0530 Subject: [PATCH 051/132] [IMP] crm: Improved string on phonecall2opportunity.yml bzr revid: ron@tinyerp.com-20111018053037-u9s24ffbjusg8cfj --- .../crm/test/process/phonecall2opportunity.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/addons/crm/test/process/phonecall2opportunity.yml b/addons/crm/test/process/phonecall2opportunity.yml index 2575daf8665..03671d6df3b 100644 --- a/addons/crm/test/process/phonecall2opportunity.yml +++ b/addons/crm/test/process/phonecall2opportunity.yml @@ -1,19 +1,19 @@ -- | - For customer or partner purpose, I called to him/her for discussion about openerp. - As the success of phonecall seems to be a real business opportunity, It will convert - it to opportunity. +- + For customer purpose, I called to him/her for discussion about openerp. + As the success of phonecall seems to be a real business opportunity, so first i + create record of phonecall. - !record {model: crm.phonecall2opportunity, id: crm_phonecall2opportunity_disc_openerp}: name: Discuss Review Process partner_id: base.res_partner_tinyatwork - - Succeed phonecall, it will be convert into on opportunity. + Succeed phonecall, it's convert into on opportunity. - !python {model: crm.phonecall2opportunity}: | self.action_apply(cr, uid, [ref("crm_phonecall2opportunity_disc_openerp")], {"active_id": ref("crm_case_phone04")}) -- | - For business And I check that the phonecall and the newly created business - opportunity is linked to same partner and also check with phonecall closed and opportunity +- + I check that the phonecall and the newly created business opportunity is + linked to same partner and also check with phonecall closed and opportunity is on intial stage or not. - !python {model: crm.phonecall}: | From 570c0fabc53191d7d7706dc75f70240def1885d7 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Tue, 18 Oct 2011 11:15:30 +0530 Subject: [PATCH 052/132] [REN]: crm: 1) Renamed from phonecall2opportunity.yml to phone-call2meeting.yml, 2) Renamed from phonecall2opportunity.yml to phone-call2opportunity.yml, 3) Renamed from schedule_other_phonecall.yml to schedule_other_phone-call.yml, 4) Updated __openerp__.py bzr revid: ron@tinyerp.com-20111018054530-b06brnnspgalkjmb --- addons/crm/__openerp__.py | 6 +++--- .../{phonecall2meeting.yml => phone-call2meeting.yml} | 0 ...phonecall2opportunity.yml => phone-call2opportunity.yml} | 0 ...le_other_phonecall.yml => schedule_other_phone-call.yml} | 0 4 files changed, 3 insertions(+), 3 deletions(-) rename addons/crm/test/process/{phonecall2meeting.yml => phone-call2meeting.yml} (100%) rename addons/crm/test/process/{phonecall2opportunity.yml => phone-call2opportunity.yml} (100%) rename addons/crm/test/process/{schedule_other_phonecall.yml => schedule_other_phone-call.yml} (100%) diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index b7d4332d319..fb2aa8679d4 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -127,9 +127,9 @@ Creates a dashboard for CRM that includes: 'test/process/meeting.yml', 'test/process/mass_leads2opportunity.yml', 'test/ui/lead_form.yml', - 'test/process/phonecall2opportunity.yml', - 'test/process/phonecall2meeting.yml', - 'test/process/schedule_other_phonecall.yml' + 'test/process/phone-call2opportunity.yml', + 'test/process/phone-call2meeting.yml', + 'test/process/schedule_other_phone-call.yml' ], 'installable': True, 'active': False, diff --git a/addons/crm/test/process/phonecall2meeting.yml b/addons/crm/test/process/phone-call2meeting.yml similarity index 100% rename from addons/crm/test/process/phonecall2meeting.yml rename to addons/crm/test/process/phone-call2meeting.yml diff --git a/addons/crm/test/process/phonecall2opportunity.yml b/addons/crm/test/process/phone-call2opportunity.yml similarity index 100% rename from addons/crm/test/process/phonecall2opportunity.yml rename to addons/crm/test/process/phone-call2opportunity.yml diff --git a/addons/crm/test/process/schedule_other_phonecall.yml b/addons/crm/test/process/schedule_other_phone-call.yml similarity index 100% rename from addons/crm/test/process/schedule_other_phonecall.yml rename to addons/crm/test/process/schedule_other_phone-call.yml From cc262bbd1ea9384aa5904b0bd0fc43142c1619ee Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Tue, 18 Oct 2011 12:00:30 +0530 Subject: [PATCH 053/132] [ADD, MOVE] crm_claim: 1)Added process directory: crm_claim/test/process, 2) Move and renamed file from crm_claim/test/test_crm_claim.yml => crm_claim/test/process/claim.yml bzr revid: ron@tinyerp.com-20111018063030-4dp0jkjbmpu0csml --- addons/crm_claim/test/{test_crm_claim.yml => process/claim.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename addons/crm_claim/test/{test_crm_claim.yml => process/claim.yml} (100%) diff --git a/addons/crm_claim/test/test_crm_claim.yml b/addons/crm_claim/test/process/claim.yml similarity index 100% rename from addons/crm_claim/test/test_crm_claim.yml rename to addons/crm_claim/test/process/claim.yml From b7641ab3d213426e34cc2fdf7c423f4880aa415b Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Tue, 18 Oct 2011 12:43:58 +0530 Subject: [PATCH 054/132] [IMP, REM] crm_claim: All changes done in claim.yml 1) Removed code of onchange_partner_id, onchange_partner_address_id, stage_change 2) Updated code only claim is open to close process 3) updated __openerp__.py bzr revid: ron@tinyerp.com-20111018071358-l5424dpckx7327n1 --- addons/crm_claim/__openerp__.py | 2 +- addons/crm_claim/test/process/claim.yml | 48 ++++++------------------- 2 files changed, 12 insertions(+), 38 deletions(-) diff --git a/addons/crm_claim/__openerp__.py b/addons/crm_claim/__openerp__.py index ae493c5dac2..2fabcd4b100 100644 --- a/addons/crm_claim/__openerp__.py +++ b/addons/crm_claim/__openerp__.py @@ -48,7 +48,7 @@ automatically new claims based on incoming emails. 'demo_xml': [ 'crm_claim_demo.xml', ], - 'test': ['test/test_crm_claim.yml'], + 'test': ['test/process/claim.yml'], 'installable': True, 'active': False, 'certificate' : '00612027414703404749', diff --git a/addons/crm_claim/test/process/claim.yml b/addons/crm_claim/test/process/claim.yml index 9ee130329a7..b12698797cb 100644 --- a/addons/crm_claim/test/process/claim.yml +++ b/addons/crm_claim/test/process/claim.yml @@ -1,44 +1,18 @@ -- | - 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 - 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') - email_from: info@balmerinc.be - name: 'Damaged product ' - partner_address_id: base.res_partner_address_1 - partner_id: base.res_partner_9 - priority: '2' - section_id: crm.section_sales_department - -- | - I check that the claims is in 'draft' state. + I check claim which contain customer claim information about + product related problem. - - !assert {model: crm.claim, id: crm_claim_damagedproduct0}: - - state == 'draft' -- | - I can change that stage by next button right on it. -- - !python {model: crm.claim}: | - self.stage_next(cr, uid, [ref('crm_claim_damagedproduct0')]) -- | 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. + self.case_open(cr, uid, [ref('crm_case_claim04')]) + claim = self.browse(cr, uid, ref('crm_case_claim04')) + assert claim.state == "open", "Claim is not in Open state" + assert claim.stage_id.id == ref("crm.stage_lead1"), "Claim is not in New stage" +- + After complete all service from our side i close this 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')], 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) - + self.case_close(cr, uid, [ref('crm_case_claim04')]) + claim = self.browse(cr, uid, ref('crm_case_claim04')) + assert claim.state == "done", "Claim is not in close state" From 83b5a42efce56ac25f007f476587d554736b49b4 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Tue, 18 Oct 2011 15:26:22 +0530 Subject: [PATCH 055/132] [ADD] crm_claim: 1) Added directory =>crm_claim/test/ui, 1) Added file crm_claim/test/ui/claim_form.yml, 2) covered partner_onchange_id and checked data bzr revid: ron@tinyerp.com-20111018095622-ceg2nur0nlt93pjp --- addons/crm_claim/__openerp__.py | 3 ++- addons/crm_claim/test/ui/claim_form.yml | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 addons/crm_claim/test/ui/claim_form.yml diff --git a/addons/crm_claim/__openerp__.py b/addons/crm_claim/__openerp__.py index 2fabcd4b100..8f0aef1bf37 100644 --- a/addons/crm_claim/__openerp__.py +++ b/addons/crm_claim/__openerp__.py @@ -48,7 +48,8 @@ automatically new claims based on incoming emails. 'demo_xml': [ 'crm_claim_demo.xml', ], - 'test': ['test/process/claim.yml'], + 'test': ['test/process/claim.yml', + 'test/ui/claim_form.yml'], 'installable': True, 'active': False, 'certificate' : '00612027414703404749', diff --git a/addons/crm_claim/test/ui/claim_form.yml b/addons/crm_claim/test/ui/claim_form.yml new file mode 100644 index 00000000000..bbf37688ed6 --- /dev/null +++ b/addons/crm_claim/test/ui/claim_form.yml @@ -0,0 +1,8 @@ +- + In order to test for changes on partner, data change automatically according to partner. +- + !python {model: crm.claim}: | + partner_onchange = self.onchange_partner_id(cr, uid, [ref('crm_case_claim04')], ref('base.res_partner_10')) + assert partner_onchange['value']['partner_phone'] == "+33-658-256545" ,"Phone number is wrong" + assert partner_onchange['value']['partner_address_id'] == 20 ,"Address is wrong" + assert partner_onchange['value']['email_from'] == 'l.dupont@tecsas.fr' ,"Email address is wrong" From fe454d5d26707e527f3b2d42c259d62bb2c1e895 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Tue, 18 Oct 2011 16:31:39 +0530 Subject: [PATCH 056/132] [ADD, MOVE] crm_helpdesk: 1) added directory =>crm_helpdesk/test/process, 2) renamed file crm_helpdesk/test/test_crm_helpdesk.yml => crm_helpdesk/test/process/help-desk.yml bzr revid: ron@tinyerp.com-20111018110139-i88q4i1nf17t1h4y --- .../test/{test_crm_helpdesk.yml => process/help-desk.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename addons/crm_helpdesk/test/{test_crm_helpdesk.yml => process/help-desk.yml} (100%) diff --git a/addons/crm_helpdesk/test/test_crm_helpdesk.yml b/addons/crm_helpdesk/test/process/help-desk.yml similarity index 100% rename from addons/crm_helpdesk/test/test_crm_helpdesk.yml rename to addons/crm_helpdesk/test/process/help-desk.yml From 7724dda7bb570f5abccbcbf4eaa8bbf65c404eee Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Wed, 19 Oct 2011 11:50:35 +0530 Subject: [PATCH 057/132] [IMP] crm_helpdesk: Improved help-desk.yml, first create message manually regarding functional question for helpdesk and test it, open this helpdesk and update that message accordingly, after i complete this helpdesk then close it bzr revid: ron@tinyerp.com-20111019062035-mxa0kdia4tfhxf2w --- addons/crm_helpdesk/__openerp__.py | 2 +- .../crm_helpdesk/test/process/help-desk.yml | 68 ++++--------------- 2 files changed, 15 insertions(+), 55 deletions(-) diff --git a/addons/crm_helpdesk/__openerp__.py b/addons/crm_helpdesk/__openerp__.py index 5124c3c5817..2adf7d26dcc 100644 --- a/addons/crm_helpdesk/__openerp__.py +++ b/addons/crm_helpdesk/__openerp__.py @@ -49,7 +49,7 @@ and categorize your interventions with a channel and a priority level. 'demo_xml': [ 'crm_helpdesk_demo.xml', ], - 'test': ['test/test_crm_helpdesk.yml'], + 'test': ['test/process/help-desk.yml'], 'installable': True, 'active': False, 'certificate' : '00830691522781519309', diff --git a/addons/crm_helpdesk/test/process/help-desk.yml b/addons/crm_helpdesk/test/process/help-desk.yml index eb0a25d2110..687238ab269 100644 --- a/addons/crm_helpdesk/test/process/help-desk.yml +++ b/addons/crm_helpdesk/test/process/help-desk.yml @@ -1,57 +1,17 @@ - - | - I start by creating New helpdesk request regarding some functional questions. - I select Date at which helpdesk request is created. -- - !record {model: crm.helpdesk, id: crm_helpdesk_somefunctionalquestion0}: - date: !eval time.strftime('%Y-%m-%d %H:%M:%S') - email_from: info@balmerinc.be - name: Some functional question. - partner_address_id: base.res_partner_address_1 - partner_id: base.res_partner_9 - section_id: crm.section_sales_department -- - I create the message. + I start by create helpdesk request regarding some functional questions, + so first create message manually regarding functional question for helpdesk + and test it, open this helpdesk and update that message accordingly, after + i complete this helpdesk then close it. - !python {model: crm.helpdesk}: | - msg = { - 'subject': 'test_email', - 'body_text': 'Testing', - 'from': 'Administrator ', - } - context = None - self.message_new(cr, uid,msg,context) - -- | - I check that the Helpdesk request is in 'Draft' state. -- - !assert {model: crm.helpdesk, id: crm_helpdesk_somefunctionalquestion0}: - - state == 'draft' -- | - I make it "Open". -- - !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_text': 'Testing', - 'from': 'Administrator ', - 'priority': 'done' - } - context = None - default_act = 'pending' - 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. -- - !python {model: crm.helpdesk}: | - self.case_close(cr, uid, [ref('crm_helpdesk_somefunctionalquestion0')]) + msg = {'subject': 'Functional questions', 'body_text': 'How the CRM working?', 'from': 'admin@openerp.com'} + helpdesk_id = self.message_new(cr, uid, msg, context=None) + data = self.browse(cr, uid ,helpdesk_id) + assert data.name == "Functional questions", "Subject name is incorrect" + assert data.email_from == "admin@openerp.com","Email Id incorrect" + assert data.description == "How the CRM working?", "Description is incorrect" + self.case_open(cr, uid, [helpdesk_id]) + msg = {'subject': 'Email regarding to CRM', 'body_text': 'Details of CRM Documentation', 'from': 'admin@openerp.com'} + self.message_update(cr, uid,[helpdesk_id], msg, default_act = 'pending',context=None) + self.case_close(cr, uid, [helpdesk_id]) \ No newline at end of file From ba3e68b09243cf14006fe3c055e455463099a621 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Wed, 19 Oct 2011 12:43:25 +0530 Subject: [PATCH 058/132] [FIX]: crm_partner_assign: Cannot find field body in the following view parts composing the view of object model crm.lead.forward.to.partner bzr revid: ron@tinyerp.com-20111019071325-vwxdwdtmk42bia48 --- .../crm_partner_assign/wizard/crm_forward_to_partner_view.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/crm_partner_assign/wizard/crm_forward_to_partner_view.xml b/addons/crm_partner_assign/wizard/crm_forward_to_partner_view.xml index 8bdb03cf962..aa2c45ea1c9 100644 --- a/addons/crm_partner_assign/wizard/crm_forward_to_partner_view.xml +++ b/addons/crm_partner_assign/wizard/crm_forward_to_partner_view.xml @@ -35,7 +35,7 @@ - +