[ADD]crm : Add files for Imp Test cases
bzr revid: dbr@tinyerp.com-20110907105359-9798b7ynlhws00xf
This commit is contained in:
parent
3562ab3d51
commit
fe76d87d8e
|
@ -130,6 +130,8 @@ Creates a dashboard for CRM that includes:
|
||||||
'test/test_crm_lead_case2.yml',
|
'test/test_crm_lead_case2.yml',
|
||||||
'test/test_crm_opportunity_case2.yml',
|
'test/test_crm_opportunity_case2.yml',
|
||||||
'test/test_crm_phonecall_case2.yml',
|
'test/test_crm_phonecall_case2.yml',
|
||||||
|
'test/test_crm_partner2opportunity.yml',
|
||||||
|
'test/test_crm_segmentation.yml',
|
||||||
],
|
],
|
||||||
'installable': True,
|
'installable': True,
|
||||||
'active': False,
|
'active': False,
|
||||||
|
|
|
@ -150,11 +150,37 @@
|
||||||
-
|
-
|
||||||
!python {model: crm.add.note}: |
|
!python {model: crm.add.note}: |
|
||||||
try:
|
try:
|
||||||
context.update({'active_model': ref("crm_lead_newcustomer0")})
|
context.update({'active_model': "crm.lead"})
|
||||||
model = context.get('active_model') or False
|
model = ref("crm_lead_newcustomer0") or False
|
||||||
self.action_add(cr, uid, [ref("crm_add_note0")],context)
|
self.action_add(cr, uid, [ref("crm_add_note0")],context)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
-
|
||||||
|
Creating crm.send.mail report
|
||||||
|
-
|
||||||
|
!record {model: crm.send.mail, id: crm_send_mail0}:
|
||||||
|
#email_to: info@axelor.com
|
||||||
|
#email_from: admin@openerp.com
|
||||||
|
#reply_to: sales_openerp@openerp.com
|
||||||
|
#subject: latest
|
||||||
|
#body: test
|
||||||
|
#state: draft
|
||||||
|
{}
|
||||||
|
-
|
||||||
|
I close lead by click on "close" button,
|
||||||
|
-
|
||||||
|
!python {model: crm.send.mail}: |
|
||||||
|
fields = {
|
||||||
|
'email_to': 'info@axelor.com',
|
||||||
|
'email_from': 'Administrator <admin@openerp.com>',
|
||||||
|
'subject': 'latest',
|
||||||
|
'body': 'test',
|
||||||
|
'reply_to': 'sales_openerp@openerp.com',
|
||||||
|
'state': 'draft'
|
||||||
|
}
|
||||||
|
self.default_get(cr, uid, fields, {'active_ids':[ref('crm_lead_newcustomer0')],'active_id':ref('crm_lead_newcustomer0'),'active_model':'crm.lead'})
|
||||||
|
#self.action_mass_send(cr, uid, [ref('crm_send_mail0')], {'active_ids':[ref('crm_send_mail0')],'active_id':ref('crm_send_mail0')})
|
||||||
|
self.get_reply_defaults(cr, uid, fields, {'active_ids':[ref('crm_send_mail0')],'active_id':ref('crm_send_mail0')})
|
||||||
-
|
-
|
||||||
I close lead by click on "close" button,
|
I close lead by click on "close" button,
|
||||||
-
|
-
|
||||||
|
@ -175,6 +201,7 @@
|
||||||
-
|
-
|
||||||
!assert {model: crm.lead, id: crm_lead_newcustomer0, string: Lead in cancel state}:
|
!assert {model: crm.lead, id: crm_lead_newcustomer0, string: Lead in cancel state}:
|
||||||
- state == "cancel"
|
- state == "cancel"
|
||||||
|
|
||||||
#-
|
#-
|
||||||
# |
|
# |
|
||||||
# yaml is also not working with smtp server and send new email.
|
# yaml is also not working with smtp server and send new email.
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
- |
|
||||||
|
I start by creating a new opportunity from partner.
|
||||||
|
-
|
||||||
|
!record {model: crm.partner2opportunity, id: crm_partner2opportunity_id_0}:
|
||||||
|
name: test
|
||||||
|
planned_revenue: 0.0
|
||||||
|
probability: 0.0
|
||||||
|
-
|
||||||
|
Now, click on "Create Opportunity" button of this wizard.
|
||||||
|
-
|
||||||
|
!python {model: crm.partner2opportunity}: |
|
||||||
|
self.default_get(cr, uid, [ref("crm_partner2opportunity_id_0")], {"active_ids": [ref("crm_partner2opportunity_id_0")]})
|
||||||
|
- |
|
||||||
|
In order to check the opportunity is created or not, I check type.
|
||||||
|
-
|
||||||
|
!python {model: crm.partner2opportunity}: |
|
||||||
|
opportunity = self.make_opportunity(cr, uid, [ref("crm_partner2opportunity_id_0")], {"active_ids": [ref("crm_partner2opportunity_id_0")]})
|
||||||
|
assert True
|
|
@ -0,0 +1,36 @@
|
||||||
|
- |
|
||||||
|
Now I will test segmentation which create specific partner categories criteria.
|
||||||
|
-
|
||||||
|
Creating a new segmentation record.
|
||||||
|
-
|
||||||
|
!record {model: crm.segmentation, id: crm_segmentation_id_0}:
|
||||||
|
categ_id: base.res_partner_category_5
|
||||||
|
exclusif: true
|
||||||
|
name: segment
|
||||||
|
som_interval: 0.0
|
||||||
|
-
|
||||||
|
Now, Start the process,
|
||||||
|
-
|
||||||
|
!python {model: crm.segmentation}: |
|
||||||
|
self.process_start(cr, uid, [ref("crm_segmentation_id_0")],context)
|
||||||
|
-
|
||||||
|
Continue the segmentation process.
|
||||||
|
-
|
||||||
|
!python {model: crm.segmentation}: |
|
||||||
|
context.update({'start': True})
|
||||||
|
self.process_continue(cr, uid, [ref("crm_segmentation_id_0")], context)
|
||||||
|
-
|
||||||
|
Create the segmentation line.
|
||||||
|
-
|
||||||
|
!record {model: crm.segmentation.line, id: crm_segmentation_line_id_0}:
|
||||||
|
expr_name: sale
|
||||||
|
expr_operator: '>'
|
||||||
|
expr_value: 1000.0
|
||||||
|
name: Rule1
|
||||||
|
operator: or
|
||||||
|
segmentation_id: crm_segmentation_id_0
|
||||||
|
-
|
||||||
|
Checking the Segmentation line record.
|
||||||
|
-
|
||||||
|
!python {model: crm.segmentation.line}: |
|
||||||
|
self.test(cr, uid, [ref("crm_segmentation_line_id_0")],partner_id=0)
|
Loading…
Reference in New Issue