[IMP]crm : Improve the test cases

bzr revid: dbr@tinyerp.com-20110907130153-x0giuqans4nq00l8
This commit is contained in:
DBR (OpenERP)
2011-09-07 18:31:53 +05:30
parent fe76d87d8e
commit 570e6ea1bd
5 changed files with 70 additions and 38 deletions
+27 -37
View File
@@ -86,6 +86,30 @@
-
!python {model: crm.lead2opportunity.partner}: |
self.action_apply(cr, uid, [ref("crm_lead2opportunity_partner_create_0")], {'active_ids': [ref("crm_lead_newcustomer0")], 'active_id': ref("crm_lead_newcustomer0")})
-
|
Now, select "Link to an existing partner" option in this wizard.
-
!record {model: crm.lead2opportunity.partner, id: crm_lead2opportunity_partner_create_1}:
action: 'exist'
name: 'existing partner'
-
Then, Click on "Create Opportunity" button of this wizard.
-
!python {model: crm.lead2opportunity.partner}: |
self.action_apply(cr, uid, [ref("crm_lead2opportunity_partner_create_1")], {'active_ids': [ref("crm_lead_newcustomer0")], 'active_id': ref("crm_lead_newcustomer0")})
-
|
Now, select "Do not link to a partner" option in this wizard.
-
!record {model: crm.lead2opportunity.partner, id: crm_lead2opportunity_partner_create_2}:
action: 'nothing'
name: 'Do not link to a partner'
-
Then, Click on "Create Opportunity" button of this wizard.
-
!python {model: crm.lead2opportunity.partner}: |
self.action_apply(cr, uid, [ref("crm_lead2opportunity_partner_create_2")], {'active_ids': [ref("crm_lead_newcustomer0")], 'active_id': ref("crm_lead_newcustomer0")})
- |
In order to check the opportunity is created or not, I check type.
-
@@ -93,47 +117,13 @@
lead = self.browse(cr, uid, ref("crm_lead_newcustomer0"))
assert lead.type == 'opportunity'
-
Convert lead2opportunity partner record
-
!record {model: crm.lead2opportunity.partner, id: crm_lead2opportunity_partner_convert0}:
action: exist
name: convert
-
Then, Click on "Create Opportunity" button of this wizard.
-
!python {model: crm.lead2opportunity.partner}: |
self.action_apply(cr, uid, [ref("crm_lead2opportunity_partner_convert0")])
-
Creating a partner wih merge Option
-
!record {model: crm.lead2opportunity.partner, id: crm_lead2opportunity_partner_merge0}:
action: create
name: merge
-
Then, Click on "Create Opportunity" button of this wizard.
-
!python {model: crm.lead2opportunity.partner}: |
fields={}
self.action_apply(cr, uid, [ref("crm_lead2opportunity_partner_merge0")])
-
Creating a crm.lead2opportunity.partner record with existing
-
!record {model: crm.lead2opportunity.partner, id: crm_lead2opportunity_partner_convert0}:
action: exist
name: convert
partner_id: base.res_partner_desertic_hispafuentes
-
Then, Click on "Create Opportunity" button of this wizard.
-
!python {model: crm.lead2opportunity.partner}: |
self.action_apply(cr, uid, [ref("crm_lead2opportunity_partner_convert0")])
-
Creating crm.lead2opportunity.partner.mass report
-
!record {model: crm.lead2opportunity.partner.mass, id: crm_lead2opportunity_partner_mass0}:
{}
user_ids:
- base.user_root
section_id: crm.section_sales_department
-
Then, execute lead2opportunity.partner.mass wizard.
-
+8
View File
@@ -22,6 +22,8 @@
working_hours: 0.0
resource_calendar_id: resource.timesheet_group1
parent_id: crm.section_sales_department
-
I assign segmentation.
-
!record {model: res.users, id: res_users_usercrm0}:
context_section_id: crm_case_section_demosalesteam
@@ -43,6 +45,12 @@
-
!assert {model: crm.lead, id: crm_lead_democustomer, string: Lead in Draft}:
- state == "draft"
-
I create categories.
-
!record {model: crm.case.categ, id: crm_case_categ0}:
name: crm_case_section_demosalesteam
section_id: crm_case_section_demosalesteam
-
I assigning contact detail to the Lead "Demo Customer" without address.
-
@@ -4,12 +4,19 @@
!record {model: crm.partner2opportunity, id: crm_partner2opportunity_id_0}:
name: test
planned_revenue: 0.0
partner_id: base.res_partner_9
probability: 0.0
-
Now, click on "Create Opportunity" button of this wizard.
-
!python {model: crm.partner2opportunity}: |
self.default_get(cr, uid, [ref("crm_partner2opportunity_id_0")], {"active_ids": [ref("crm_partner2opportunity_id_0")]})
fields = {
'name': 'test',
'planned_revenue': '0.0',
'partner_id': ref('base.res_partner_9'),
'probability': '0.0'
}
self.default_get(cr, uid, fields, {"active_ids": [ref("crm_partner2opportunity_id_0")]})
- |
In order to check the opportunity is created or not, I check type.
-
+25
View File
@@ -17,6 +17,7 @@
Now, click on "Continue" button of this wizard.
-
!python {model: crm.phonecall2partner}: |
self._select_partner(cr, uid,{"active_ids": [ref("crm_phonecall_interviewcall0")]})
self.open_create_partner(cr, uid, [ref("crm_phonecall2partner_1")], {"active_ids": [ref("crm_phonecall_interviewcall0")]})
self.make_partner(cr, uid, [ref("crm_phonecall2partner_1")], {"active_ids": [ref("crm_phonecall_interviewcall0")]})
@@ -49,6 +50,7 @@
!python {model: crm.phonecall}: |
obj_phonecall = self.browse(cr, uid, ref('crm_phonecall_interviewcall0'))
ids = self.pool.get('crm.lead').search(cr, uid, [('name', '=', obj_phonecall.opportunity_id.name)])
#self.case_reset(cr, uid, ids)
obj_opp = self.pool.get('crm.lead').browse(cr, uid, ids)[0]
assert obj_phonecall.partner_id == obj_opp.partner_id
@@ -87,9 +89,32 @@
name: Interview call
section_id: crm.section_sales_department
user_id: base.user_root
action: schedule
categ_id: crm.categ_phone1
-
I click on "schedule other call" button. and plan for other call.
-
!record {model: crm.phonecall2phonecall, id: crm_phonecall2phonecall_interviewcall1}:
date: !eval "'%s-%s-%s 19:49:00' %(datetime.now().year,datetime.now().month,datetime.now().day)"
name: Interview call
section_id: crm.section_sales_department
user_id: base.user_root
action: log
categ_id: crm.categ_phone1
- |
I click on "Schedule" button of this wizard.
-
!python {model: crm.phonecall2phonecall}: |
fields = {
'name': 'Interview call',
'section_id': ref('crm.section_sales_department'),
'user_id': ref('base.user_root'),
'categ_id': ref('crm.categ_phone1')
}
self.default_get(cr, uid, fields,{'active_id': ref('crm_phonecall_interviewcall0')})
self.action_apply(cr, uid, [ref('crm_phonecall2phonecall_interviewcall0')], {'active_id': ref('crm_phonecall_interviewcall0')})
- |
I click on "Schedule" button of this wizard with log option.
-
!python {model: crm.phonecall2phonecall}: |
self.action_apply(cr, uid, [ref('crm_phonecall2phonecall_interviewcall1')], {'active_id': ref('crm_phonecall_interviewcall0')})
@@ -8,6 +8,7 @@
exclusif: true
name: segment
som_interval: 0.0
sales_purchase_active : True
-
Now, Start the process,
-
@@ -29,6 +30,7 @@
name: Rule1
operator: or
segmentation_id: crm_segmentation_id_0
-
Checking the Segmentation line record.
-