Atik Agewan(OpenERP) has proposed merging
lp:~openerp-dev/openobject-addons/trunk-crm-wiz-yml-aag into
lp:openobject-addons.
Requested reviews:
OpenERP Core Team (openerp)
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-crm-wiz-yml-aag/+merge/85486
Hello,
CRM: Improvements in ymls to increase Coverage.
Thanks,
Atik Agewan
--
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-crm-wiz-yml-aag/+merge/85486
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-addons/trunk-crm-wiz-yml-aag.
=== modified file 'crm/crm_action_rule.py'
--- crm/crm_action_rule.py 2011-11-08 22:53:37 +0000
+++ crm/crm_action_rule.py 2011-12-13 13:35:26 +0000
@@ -125,7 +125,7 @@
"""Gets available states for crm"""
res = super(base_action_rule, self).state_get(cr, uid, context=context)
return res + crm.AVAILABLE_STATES
-
+ # Dead Code
def priority_get(self, cr, uid, context=None):
res = super(base_action_rule, self).priority_get(cr, uid, context=context)
return res + crm.AVAILABLE_PRIORITIES
=== modified file 'crm/crm_phonecall.py'
--- crm/crm_phonecall.py 2011-11-23 06:28:13 +0000
+++ crm/crm_phonecall.py 2011-12-13 13:35:26 +0000
@@ -118,7 +118,7 @@
"""Resets case as Todo
"""
res = super(crm_phonecall, self).case_reset(cr, uid, ids, args, 'crm.phonecall')
- self.write(cr, uid, ids, {'duration': 0.0})
+ self.write(cr, uid, ids, {'duration': 0.0, 'state':'open'})
return res
=== modified file 'crm/test/process/cancel_lead.yml'
--- crm/test/process/cancel_lead.yml 2011-11-02 06:53:28 +0000
+++ crm/test/process/cancel_lead.yml 2011-12-13 13:35:26 +0000
@@ -51,3 +51,26 @@
assert lead.state == 'done', "lead is not done state"
assert lead.stage_id.id == ref('crm.stage_lead6'), 'Stage is not changed!'
assert lead.probability == 0.0, 'Probability is wrong!'
+-
+ I create a Record Rule.
+-
+ !python {model: base.action.rule}: |
+ modle_id = self.pool.get("ir.model").search(cr, uid, [('name', '=', 'crm.lead')])
+ from datetime import datetime
+ new_id = self.create(cr, uid, {'name': 'New Rule', 'model_id': modle_id[0], 'trg_user_id': ref('base.user_root'), 'trg_partner_id': ref('base.res_partner_asus'), 'act_user_id': ref('base.user_demo') })
+ lead_obj = self.pool.get("crm.lead")
+ self._check(cr, uid)
+-
+ I create New Lead To Check Record Rule.
+-
+ !record {model: crm.lead, id: crm_lead_test_rules_id }:
+ name: 'test leads Ruels'
+ user_id: base.user_root
+ partner_id: base.res_partner_asus
+-
+ I Check Record Rule is Apply and Responsible is Changed.
+-
+ !python {model: crm.lead}: |
+ user = self.browse(cr, uid, ref('crm_lead_test_rules_id'))
+ demo_user = self.pool.get("res.users").browse(cr, uid, ref('base.user_demo'))
+ assert user.user_id.id == demo_user.id, "Responsible is Not changed."
=== modified file 'crm/test/process/communication_with_customer.yml'
--- crm/test/process/communication_with_customer.yml 2011-11-23 11:44:59 +0000
+++ crm/test/process/communication_with_customer.yml 2011-12-13 13:35:26 +0000
@@ -41,10 +41,12 @@
partner_ids = self.message_partner_by_email(cr, uid, 'Mr. John Right <[email protected]>')
assert partner_ids.get('partner_id'), "Customer is not found in regular customer list."
-
- I convert one phonecall request as a customer and put into regular customer list.
+ I convert one phonecall request as a customer and put into regular customer list.
-
- !python {model: crm.phonecall}: |
- self.convert_partner(cr, uid, [ref('crm.crm_case_phone06')], context=context)
+ !python {model: crm.phonecall2partner}: |
+ context.update({'active_model': 'crm.phonecall', 'active_ids': [ref("crm.crm_case_phone06")], 'active_id': ref("crm.crm_case_phone06")})
+ new_id = self.create(cr, uid, {}, context=context)
+ self.make_partner(cr, uid, [new_id], context=context)
-
I check converted phonecall to partner.
-
=== modified file 'crm/test/process/lead2opportunity2win.yml'
--- crm/test/process/lead2opportunity2win.yml 2011-11-23 11:44:59 +0000
+++ crm/test/process/lead2opportunity2win.yml 2011-12-13 13:35:26 +0000
@@ -5,12 +5,20 @@
-
!python {model: crm.lead}: |
self.case_open(cr, uid, [ref("crm_case_qrecorp0")])
+ context.update({'active_model': 'crm.lead','active_ids': [ref("crm_case_qrecorp0")]})
-
- I check lead state is "Open".
+ I check lead state is "Open".
-
!assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: Lead in open state}:
- state == "open"
-
+ I create partner from lead.
+-
+ !record {model: crm.lead2partner, id: crm_lead2partner_id1 }:
+-
+ !python {model: crm.lead2partner}: |
+ self.make_partner(cr, uid ,[ref("crm_lead2partner_id1")], context=context)
+-
I convert lead into opportunity for exiting customer.
-
!python {model: crm.lead}: |
@@ -87,4 +95,16 @@
opp = self.browse(cr, uid, ref('crm_case_electonicgoodsdealer0'))
assert opp.name == "Interest in Your New Product", "Opportunity name not correct"
assert opp.type == 'opportunity', 'Lead is not converted to opportunity!'
- assert opp.stage_id.id == ref("stage_lead1"), 'Stage of probability is incorrect!'
\ No newline at end of file
+ assert opp.stage_id.id == ref("stage_lead1"), 'Stage of probability is incorrect!'
+-
+ I confirm Review needs Meeting.
+-
+ !python {model: crm.meeting}: |
+ context.update({'active_model': 'crm.meeting'})
+ self.case_open(cr, uid, [ref('crm.crm_case_reviewneeds0')])
+-
+ I Invite a user for Meeting.
+-
+ !python {model: calendar.attendee}: |
+ meeting_id = self.create(cr, uid, {'user_id': ref('base.user_root'), 'email': '[email protected]' })
+ self.do_accept(cr, uid, [meeting_id])
=== modified file 'crm/test/process/merge_opportunity.yml'
--- crm/test/process/merge_opportunity.yml 2011-11-23 10:50:06 +0000
+++ crm/test/process/merge_opportunity.yml 2011-12-13 13:35:26 +0000
@@ -9,17 +9,22 @@
I make another opportunity from phonecall for same customer.
-
!python {model: crm.phonecall2opportunity}: |
- context.update({'active_model': 'crm.phonecall', 'active_ids': [ref("crm.crm_case_phone06")]})
+ context.update({'active_model': 'crm.phonecall', 'active_ids': [ref("crm.crm_case_phone06")], 'active_id': ref("crm.crm_case_phone06")})
res_id = self.create(cr, uid, {'name': "Quoi de prix de votre autre service?", 'partner_id': ref("base.res_partner_9")}, context=context)
self.make_opportunity(cr, uid, [res_id], context=context)
-
- Now I merge all opportunities of customer.
+ Now I merge all opportunities of customer.
-
!python {model: crm.lead}: |
opportunity_ids = self.search(cr, uid, [('partner_id','=', ref("base.res_partner_9"))])
- self.merge_opportunity(cr, uid, opportunity_ids, context=context)
--
- I check for merged opportunities for customer.
+ context.update({'active_model': 'crm.lead','active_ids': opportunity_ids})
+-
+ !record {model: crm.merge.opportunity, id: opportunity_merge_id }:
+-
+ !python {model: crm.merge.opportunity}: |
+ self.action_merge(cr, uid, [ref("opportunity_merge_id")], context=context)
+-
+ I check for merged opportunities for customer.
-
!python {model: crm.lead}: |
merge_id = self.search(cr, uid, [('partner_id','=', ref("base.res_partner_9"))])
@@ -31,7 +36,7 @@
Now I schedule another phonecall to customer after merged.
-
!python {model: crm.phonecall2phonecall}: |
- context.update({'active_model': 'crm.phonecall', 'active_ids': [ref("crm.crm_case_phone06")]})
+ context.update({'active_model': 'crm.phonecall', 'active_ids': [ref("crm.crm_case_phone06")], 'active_id': ref("crm.crm_case_phone06")})
res_id = self.create(cr, uid, {'name': "vos chances sont fusionnés en un seul"}, context=context)
self.action_schedule(cr, uid, [res_id], context=context)
-
@@ -40,6 +45,36 @@
!python {model: crm.phonecall}: |
self.action_make_meeting(cr, uid, [ref("crm.crm_case_phone06")])
-
+ I set Phone call to Not Held.
+-
+ !python {model: crm.phonecall}: |
+ self.case_pending(cr, uid, [ref("crm.crm_case_phone06")])
+-
+ I check that the phone call is in 'Not Held' state.
+-
+ !assert {model: crm.phonecall, id: crm.crm_case_phone06, string: Phone call Helded}:
+ - state == "pending"
+-
+ I Cancelled the Phone call.
+-
+ !python {model: crm.phonecall}: |
+ self.case_cancel(cr, uid, [ref("crm.crm_case_phone06")])
+-
+ I check that the phone call is in 'Cancelled' state.
+-
+ !assert {model: crm.phonecall, id: crm.crm_case_phone06, string: Phone call Helded}:
+ - state == "cancel"
+-
+ I Reset the Phone call.
+-
+ !python {model: crm.phonecall}: |
+ self.case_reset(cr, uid, [ref("crm.crm_case_phone06")])
+-
+ I check that the phone call is Reset or Not
+-
+ !assert {model: crm.phonecall, id: crm.crm_case_phone06, string: Phone call Helded}:
+ - state == "open"
+-
I setting Phone call to Held (Done).
-
!python {model: crm.phonecall}: |
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp