diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index 0e51637d0b7..40a7084adae 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -130,6 +130,8 @@ Creates a dashboard for CRM that includes: 'test/test_crm_lead_case2.yml', 'test/test_crm_opportunity_case2.yml', 'test/test_crm_phonecall_case2.yml', + 'test/test_crm_partner2opportunity.yml', + 'test/test_crm_segmentation.yml', ], 'installable': True, 'active': False, diff --git a/addons/crm/test/test_crm_lead.yml b/addons/crm/test/test_crm_lead.yml index 112a5ce3d76..002d57a994a 100644 --- a/addons/crm/test/test_crm_lead.yml +++ b/addons/crm/test/test_crm_lead.yml @@ -150,11 +150,37 @@ - !python {model: crm.add.note}: | try: - context.update({'active_model': ref("crm_lead_newcustomer0")}) - model = context.get('active_model') or False + context.update({'active_model': "crm.lead"}) + model = ref("crm_lead_newcustomer0") or False self.action_add(cr, uid, [ref("crm_add_note0")],context) except: pass +- + Creating crm.send.mail report +- + !record {model: crm.send.mail, id: crm_send_mail0}: + #email_to: info@axelor.com + #email_from: admin@openerp.com + #reply_to: sales_openerp@openerp.com + #subject: latest + #body: test + #state: draft + {} +- + I close lead by click on "close" button, +- + !python {model: crm.send.mail}: | + fields = { + 'email_to': 'info@axelor.com', + 'email_from': 'Administrator ', + 'subject': 'latest', + 'body': 'test', + 'reply_to': 'sales_openerp@openerp.com', + 'state': 'draft' + } + self.default_get(cr, uid, fields, {'active_ids':[ref('crm_lead_newcustomer0')],'active_id':ref('crm_lead_newcustomer0'),'active_model':'crm.lead'}) + #self.action_mass_send(cr, uid, [ref('crm_send_mail0')], {'active_ids':[ref('crm_send_mail0')],'active_id':ref('crm_send_mail0')}) + self.get_reply_defaults(cr, uid, fields, {'active_ids':[ref('crm_send_mail0')],'active_id':ref('crm_send_mail0')}) - I close lead by click on "close" button, - @@ -175,6 +201,7 @@ - !assert {model: crm.lead, id: crm_lead_newcustomer0, string: Lead in cancel state}: - state == "cancel" + #- # | # yaml is also not working with smtp server and send new email. diff --git a/addons/crm/test/test_crm_partner2opportunity.yml b/addons/crm/test/test_crm_partner2opportunity.yml new file mode 100644 index 00000000000..765fbd2d9e2 --- /dev/null +++ b/addons/crm/test/test_crm_partner2opportunity.yml @@ -0,0 +1,18 @@ +- | + I start by creating a new opportunity from partner. +- + !record {model: crm.partner2opportunity, id: crm_partner2opportunity_id_0}: + name: test + planned_revenue: 0.0 + probability: 0.0 +- + Now, click on "Create Opportunity" button of this wizard. +- + !python {model: crm.partner2opportunity}: | + self.default_get(cr, uid, [ref("crm_partner2opportunity_id_0")], {"active_ids": [ref("crm_partner2opportunity_id_0")]}) +- | + In order to check the opportunity is created or not, I check type. +- + !python {model: crm.partner2opportunity}: | + opportunity = self.make_opportunity(cr, uid, [ref("crm_partner2opportunity_id_0")], {"active_ids": [ref("crm_partner2opportunity_id_0")]}) + assert True diff --git a/addons/crm/test/test_crm_segmentation.yml b/addons/crm/test/test_crm_segmentation.yml new file mode 100644 index 00000000000..1d308aba13f --- /dev/null +++ b/addons/crm/test/test_crm_segmentation.yml @@ -0,0 +1,36 @@ +- | + Now I will test segmentation which create specific partner categories criteria. +- + Creating a new segmentation record. +- + !record {model: crm.segmentation, id: crm_segmentation_id_0}: + categ_id: base.res_partner_category_5 + exclusif: true + name: segment + som_interval: 0.0 +- + Now, Start the process, +- + !python {model: crm.segmentation}: | + self.process_start(cr, uid, [ref("crm_segmentation_id_0")],context) +- + Continue the segmentation process. +- + !python {model: crm.segmentation}: | + context.update({'start': True}) + self.process_continue(cr, uid, [ref("crm_segmentation_id_0")], context) +- + Create the segmentation line. +- + !record {model: crm.segmentation.line, id: crm_segmentation_line_id_0}: + expr_name: sale + expr_operator: '>' + expr_value: 1000.0 + name: Rule1 + operator: or + segmentation_id: crm_segmentation_id_0 +- + Checking the Segmentation line record. +- + !python {model: crm.segmentation.line}: | + self.test(cr, uid, [ref("crm_segmentation_line_id_0")],partner_id=0)