Merge lp:~openerp-dev/openobject-addons/trunk-crm-wiz-yml-aag into lp:openobject-addons

Proposed by Atik Agewan(OpenERP)
Status: Merged
Merged at revision: 6063
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-crm-wiz-yml-aag
Merge into: lp:openobject-addons
Diff against target: 298 lines (+105/-25)
9 files modified
crm/__openerp__.py (+1/-0)
crm/crm_action_rule.py (+1/-1)
crm/crm_phonecall.py (+1/-1)
crm/test/process/action_rule.yml (+22/-0)
crm/test/process/cancel_lead.yml (+2/-2)
crm/test/process/communication_with_customer.yml (+6/-4)
crm/test/process/lead2opportunity2win.yml (+27/-7)
crm/test/process/merge_opportunity.yml (+44/-9)
crm/test/process/segmentation.yml (+1/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-crm-wiz-yml-aag
Reviewer Review Type Date Requested Status
Raphael Collet (OpenERP) (community) Approve
Ujjvala Collins (community) Approve
Atik Agewan(OpenERP) (community) Needs Resubmitting
Harry (OpenERP) (community) Needs Fixing
Review via email: mp+85486@code.launchpad.net

Description of the change

  Hello,

   CRM: Improvements in ymls to increase Coverage.

  Thanks,
   Atik Agewan

To post a comment you must log in.
Revision history for this message
Ujjvala Collins (uco-openerp) wrote :

Hello Atik,

Following are the improvements to be done in the merge proposal:
* For testing crm action rules please add a new file and remove the test from crm/test/process/cancel_lead.yml.
* line no: 85,143,159, Changes are not needed.
* line no: 174, 184, 194: "Phone call Helded" is wrong, it should be written: "Phone call held."
* Please use proper sentence case in crm/test/process/merge_opportunity.yml.

Thanks,
Ujjvala.

review: Needs Fixing
Revision history for this message
Atik Agewan(OpenERP) (aag-openerp) wrote :

   Hello,

    Changes are done as per your suggestion.

  Thanks,
   Atik

Revision history for this message
Atik Agewan(OpenERP) (aag-openerp) :
review: Needs Resubmitting
Revision history for this message
Harry (OpenERP) (hmo-tinyerp) wrote :

hello Atik

please correct failure

you can see runbot : http://runbot.openerp.com/openerp-dev-trunk-crm-wiz-yml-aag-4170/logs/test-all.txt

Thanks

review: Needs Fixing
Revision history for this message
Atik Agewan(OpenERP) (aag-openerp) wrote :

  Hello,

    Changes are done.

  Thanks,

review: Needs Resubmitting
Revision history for this message
Ujjvala Collins (uco-openerp) wrote :

It seems fine to me now.

review: Approve
Revision history for this message
Raphael Collet (OpenERP) (rco-openerp) wrote :

Looks good.

Thanks,
Raphael

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'crm/__openerp__.py'
2--- crm/__openerp__.py 2011-12-12 14:22:44 +0000
3+++ crm/__openerp__.py 2011-12-16 13:12:27 +0000
4@@ -123,6 +123,7 @@
5 'test/process/lead2opportunity2win.yml',
6 'test/process/merge_opportunity.yml',
7 'test/process/cancel_lead.yml',
8+ 'test/process/action_rule.yml',
9 'test/process/segmentation.yml',
10 'test/ui/crm_demo.yml',
11 'test/ui/duplicate_lead.yml',
12
13=== modified file 'crm/crm_action_rule.py'
14--- crm/crm_action_rule.py 2011-11-08 22:53:37 +0000
15+++ crm/crm_action_rule.py 2011-12-16 13:12:27 +0000
16@@ -125,7 +125,7 @@
17 """Gets available states for crm"""
18 res = super(base_action_rule, self).state_get(cr, uid, context=context)
19 return res + crm.AVAILABLE_STATES
20-
21+ # Dead Code
22 def priority_get(self, cr, uid, context=None):
23 res = super(base_action_rule, self).priority_get(cr, uid, context=context)
24 return res + crm.AVAILABLE_PRIORITIES
25
26=== modified file 'crm/crm_phonecall.py'
27--- crm/crm_phonecall.py 2011-11-23 06:28:13 +0000
28+++ crm/crm_phonecall.py 2011-12-16 13:12:27 +0000
29@@ -118,7 +118,7 @@
30 """Resets case as Todo
31 """
32 res = super(crm_phonecall, self).case_reset(cr, uid, ids, args, 'crm.phonecall')
33- self.write(cr, uid, ids, {'duration': 0.0})
34+ self.write(cr, uid, ids, {'duration': 0.0, 'state':'open'})
35 return res
36
37
38
39=== added file 'crm/test/process/action_rule.yml'
40--- crm/test/process/action_rule.yml 1970-01-01 00:00:00 +0000
41+++ crm/test/process/action_rule.yml 2011-12-16 13:12:27 +0000
42@@ -0,0 +1,22 @@
43+-
44+ I create a record rule.
45+-
46+ !python {model: base.action.rule}: |
47+ modle_id = self.pool.get("ir.model").search(cr, uid, [('name', '=', 'crm.lead')])
48+ from datetime import datetime
49+ 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') })
50+ lead_obj = self.pool.get("crm.lead")
51+ self._check(cr, uid)
52+-
53+ I create new lead to check record rule.
54+-
55+ !record {model: crm.lead, id: crm_lead_test_rules_id}:
56+ name: 'Test lead rules'
57+ user_id: base.user_root
58+ partner_id: base.res_partner_asus
59+-
60+ I check record rule is apply and responsible is changed.
61+-
62+ !python {model: crm.lead}: |
63+ lead_user = self.browse(cr, uid, ref('crm_lead_test_rules_id'))
64+ assert lead_user.user_id.id == ref('base.user_demo'), "Responsible of lead is not changed."
65
66=== modified file 'crm/test/process/cancel_lead.yml'
67--- crm/test/process/cancel_lead.yml 2011-11-02 06:53:28 +0000
68+++ crm/test/process/cancel_lead.yml 2011-12-16 13:12:27 +0000
69@@ -29,12 +29,12 @@
70 !assert {model: crm.lead, id: crm.crm_case_itisatelesalescampaign0, string: Lead is in pending state}:
71 - state == "pending"
72 -
73- I Escalate the Lead to Parent Team.
74+ I escalate the lead to parent team.
75 -
76 !python {model: crm.lead}: |
77 self.case_escalate(cr, uid, [ref("crm_case_itisatelesalescampaign0")])
78 -
79- I check lead escalate to Parent Team.
80+ I check lead escalate to parent team.
81 -
82 !assert {model: crm.lead, id: crm.crm_case_itisatelesalescampaign0, string: Escalate lead to parent team}:
83 - section_id.name == "Sales Department"
84
85=== modified file 'crm/test/process/communication_with_customer.yml'
86--- crm/test/process/communication_with_customer.yml 2011-11-23 11:44:59 +0000
87+++ crm/test/process/communication_with_customer.yml 2011-12-16 13:12:27 +0000
88@@ -1,5 +1,5 @@
89 -
90- Customer interested in our product. so He send request by email to get more details.
91+ Customer interested in our product. so he send request by email to get more details.
92 -
93 Mail script will be fetched him request from mail server. so I process that mail after read EML file
94 -
95@@ -41,10 +41,12 @@
96 partner_ids = self.message_partner_by_email(cr, uid, 'Mr. John Right <info@customer.com>')
97 assert partner_ids.get('partner_id'), "Customer is not found in regular customer list."
98 -
99- I convert one phonecall request as a customer and put into regular customer list.
100+ I convert one phonecall request as a customer and put into regular customer list.
101 -
102- !python {model: crm.phonecall}: |
103- self.convert_partner(cr, uid, [ref('crm.crm_case_phone06')], context=context)
104+ !python {model: crm.phonecall2partner}: |
105+ context.update({'active_model': 'crm.phonecall', 'active_ids': [ref("crm.crm_case_phone06")], 'active_id': ref("crm.crm_case_phone06")})
106+ new_id = self.create(cr, uid, {}, context=context)
107+ self.make_partner(cr, uid, [new_id], context=context)
108 -
109 I check converted phonecall to partner.
110 -
111
112=== modified file 'crm/test/process/lead2opportunity2win.yml'
113--- crm/test/process/lead2opportunity2win.yml 2011-11-23 11:44:59 +0000
114+++ crm/test/process/lead2opportunity2win.yml 2011-12-16 13:12:27 +0000
115@@ -6,11 +6,19 @@
116 !python {model: crm.lead}: |
117 self.case_open(cr, uid, [ref("crm_case_qrecorp0")])
118 -
119- I check lead state is "Open".
120+ I check lead state is "Open".
121 -
122 !assert {model: crm.lead, id: crm.crm_case_qrecorp0, string: Lead in open state}:
123 - state == "open"
124 -
125+ I create partner from lead.
126+-
127+ !record {model: crm.lead2partner, id: crm_lead2partner_id1, context: '{"active_model": "crm.lead", "active_ids": [ref("crm_case_qrecorp0")]}'}:
128+-
129+ !python {model: crm.lead2partner}: |
130+ context.update({'active_model': 'crm.lead', 'active_ids': [ref('crm_case_qrecorp0')], 'active_id': ref('crm_case_qrecorp0')})
131+ self.make_partner(cr, uid ,[ref("crm_lead2partner_id1")], context=context)
132+-
133 I convert lead into opportunity for exiting customer.
134 -
135 !python {model: crm.lead}: |
136@@ -39,13 +47,13 @@
137 ids = self.search(cr, uid, [('opportunity_id', '=', ref('crm_case_qrecorp0'))])
138 assert len(ids), 'phonecall is not scheduled'
139 -
140- Now I schedule Meeting with Customer.
141+ Now I schedule meeting with customer.
142 -
143 !python {model: crm.lead}: |
144 self.action_makeMeeting(cr, uid, [ref('crm_case_qrecorp0')])
145
146 -
147- After communicated with customer, I put some notes with Contract details.
148+ After communicated with customer, I put some notes with contract details.
149 -
150 !python {model: crm.add.note}: |
151 context.update({'active_model': 'crm.lead', 'active_id': ref('crm_case_qrecorp0')})
152@@ -57,7 +65,7 @@
153 !python {model: crm.lead}: |
154 self.case_mark_won(cr, uid, [ref("crm_case_qrecorp0")])
155 -
156- I check details of the opportunity After won the opportunity.
157+ I check details of the opportunity after won the opportunity.
158 -
159 !python {model: crm.lead}: |
160 lead = self.browse(cr, uid, ref('crm_case_qrecorp0'))
161@@ -72,7 +80,7 @@
162 id = self.create(cr, uid, {'user_ids': [ref('base.user_root')], 'section_id': ref('crm.section_sales_department')}, context=context)
163 self.mass_convert(cr, uid, [id], context=context)
164 -
165- Now I check First lead converted on opportunity.
166+ Now I check first lead converted on opportunity.
167 -
168 !python {model: crm.lead}: |
169 opp = self.browse(cr, uid, ref('crm_case_employee0'))
170@@ -81,10 +89,22 @@
171 assert opp.partner_id.name == "Agrolait", 'Partner missmatch!'
172 assert opp.stage_id.id == ref("stage_lead1"), 'Stage of probability is incorrect!'
173 -
174- Then check for Second lead converted on opportunity.
175+ Then check for second lead converted on opportunity.
176 -
177 !python {model: crm.lead}: |
178 opp = self.browse(cr, uid, ref('crm_case_electonicgoodsdealer0'))
179 assert opp.name == "Interest in Your New Product", "Opportunity name not correct"
180 assert opp.type == 'opportunity', 'Lead is not converted to opportunity!'
181- assert opp.stage_id.id == ref("stage_lead1"), 'Stage of probability is incorrect!'
182\ No newline at end of file
183+ assert opp.stage_id.id == ref("stage_lead1"), 'Stage of probability is incorrect!'
184+-
185+ I confirm review needs meeting.
186+-
187+ !python {model: crm.meeting}: |
188+ context.update({'active_model': 'crm.meeting'})
189+ self.case_open(cr, uid, [ref('crm.crm_case_reviewneeds0')])
190+-
191+ I invite a user for meeting.
192+-
193+ !python {model: calendar.attendee}: |
194+ meeting_id = self.create(cr, uid, {'user_id': ref('base.user_root'), 'email': 'user@meeting.com' })
195+ self.do_accept(cr, uid, [meeting_id])
196
197=== modified file 'crm/test/process/merge_opportunity.yml'
198--- crm/test/process/merge_opportunity.yml 2011-11-23 10:50:06 +0000
199+++ crm/test/process/merge_opportunity.yml 2011-12-16 13:12:27 +0000
200@@ -1,5 +1,5 @@
201 -
202- I make direct opportunity for Customer.
203+ I make direct opportunity for customer.
204 -
205 !python {model: crm.partner2opportunity}: |
206 context.update({'active_model': 'res.partner', 'active_ids': [ref("base.res_partner_9")]})
207@@ -13,13 +13,18 @@
208 res_id = self.create(cr, uid, {'name': "Quoi de prix de votre autre service?", 'partner_id': ref("base.res_partner_9")}, context=context)
209 self.make_opportunity(cr, uid, [res_id], context=context)
210 -
211- Now I merge all opportunities of customer.
212+ Now I merge all opportunities of customer.
213 -
214 !python {model: crm.lead}: |
215 opportunity_ids = self.search(cr, uid, [('partner_id','=', ref("base.res_partner_9"))])
216- self.merge_opportunity(cr, uid, opportunity_ids, context=context)
217--
218- I check for merged opportunities for customer.
219+ context.update({'active_model': 'crm.lead', 'active_ids': opportunity_ids, 'active_id': opportunity_ids[0]})
220+-
221+ !record {model: crm.merge.opportunity, id: opportunity_merge_id }:
222+-
223+ !python {model: crm.merge.opportunity}: |
224+ self.action_merge(cr, uid, [ref("opportunity_merge_id")], context=context)
225+-
226+ I check for merged opportunities for customer.
227 -
228 !python {model: crm.lead}: |
229 merge_id = self.search(cr, uid, [('partner_id','=', ref("base.res_partner_9"))])
230@@ -31,21 +36,51 @@
231 Now I schedule another phonecall to customer after merged.
232 -
233 !python {model: crm.phonecall2phonecall}: |
234- context.update({'active_model': 'crm.phonecall', 'active_ids': [ref("crm.crm_case_phone06")]})
235+ context.update({'active_model': 'crm.phonecall', 'active_ids': [ref("crm.crm_case_phone06")], 'active_id': ref("crm.crm_case_phone06")})
236 res_id = self.create(cr, uid, {'name': "vos chances sont fusionnés en un seul"}, context=context)
237 self.action_schedule(cr, uid, [res_id], context=context)
238 -
239- I schedule Meeting on this phonecall.
240+ I schedule meeting on this phonecall.
241 -
242 !python {model: crm.phonecall}: |
243 self.action_make_meeting(cr, uid, [ref("crm.crm_case_phone06")])
244 -
245- I setting Phone call to Held (Done).
246+ I set phone call to not held.
247+-
248+ !python {model: crm.phonecall}: |
249+ self.case_pending(cr, uid, [ref("crm.crm_case_phone06")])
250+-
251+ I check that the phone call is in 'Not Held' state.
252+-
253+ !assert {model: crm.phonecall, id: crm.crm_case_phone06, string: Phone call held.}:
254+ - state == "pending"
255+-
256+ I cancelled the phone call.
257+-
258+ !python {model: crm.phonecall}: |
259+ self.case_cancel(cr, uid, [ref("crm.crm_case_phone06")])
260+-
261+ I check that the phone call is in 'Cancelled' state.
262+-
263+ !assert {model: crm.phonecall, id: crm.crm_case_phone06, string: Phone call is not cancelled.}:
264+ - state == "cancel"
265+-
266+ I reset the phone call.
267+-
268+ !python {model: crm.phonecall}: |
269+ self.case_reset(cr, uid, [ref("crm.crm_case_phone06")])
270+-
271+ I check that the phone call is reset or not.
272+-
273+ !assert {model: crm.phonecall, id: crm.crm_case_phone06, string: Phone call is not reset.}:
274+ - state == "open"
275+-
276+ I set phone call to held (done).
277 -
278 !python {model: crm.phonecall}: |
279 self.case_close(cr, uid, [ref("crm.crm_case_phone06")])
280 -
281 I check that the phone call is in 'Held' state.
282 -
283- !assert {model: crm.phonecall, id: crm.crm_case_phone06, string: Phone call Helded}:
284+ !assert {model: crm.phonecall, id: crm.crm_case_phone06, string: Phone call is not held.}:
285 - state == "done"
286
287=== modified file 'crm/test/process/segmentation.yml'
288--- crm/test/process/segmentation.yml 2011-11-03 13:09:51 +0000
289+++ crm/test/process/segmentation.yml 2011-12-16 13:12:27 +0000
290@@ -8,7 +8,7 @@
291 #Todo: Need to check after segmentation started
292
293 -
294- I create rule Segmentation line record for partner .
295+ I create rule segmentation line record for partner .
296 -
297 !python {model: crm.segmentation.line}: |
298 id = self.create(cr, uid, {'name': "OpenERP partners",'expr_value': 25})

Subscribers

People subscribed via source and target branches

to all changes: