[merge]
[odoo/odoo.git] / addons / crm / test / test_crm_phonecall.yml
1 - |
2   I start by creating a new phonecall.
3
4   !record {model: crm.phonecall, id: crm_phonecall_interviewcall0}:
5     date: '2010-04-21 18:59:00'
6     name: Interview call
7     section_id: crm.section_sales_department
8 - |
9   Now , I select partner by click on "Create a Partner" button.
10          
11
12   !record {model: crm.phonecall2partner, id: crm_phonecall2partner_1}:
13     action: exist
14     partner_id: base.res_partner_9
15
16
17   Now, click on "Continue" button of this wizard.
18
19   !python {model: crm.phonecall2partner}: |
20     self.make_partner(cr, uid, [ref("crm_phonecall2partner_1")], {"active_ids": [ref("crm_phonecall_interviewcall0")]})    
21     
22 - |
23   As the success of phonecall seems to be a real business opportunity, I will convert
24   it to opportunity by clicking on the "Convert to Opportunity" button.
25
26   !record {model: crm.phonecall2opportunity, id: crm_phonecall2opportunity_interviewcall0}:
27     name: Interview call
28     partner_id: base.res_partner_9
29     planned_revenue: 0.0
30     probability: 0.0  
31 -
32    Now, I click on "Convert" button of this wizard.    
33 -    
34   !python {model: crm.phonecall2opportunity}: |
35      self.action_apply(cr, uid, [ref("crm_phonecall2opportunity_interviewcall0")], {"active_id": ref("crm_phonecall_interviewcall0")})
36
37 - |
38   I can see that a business opportunity is now assigned to this phonecall
39 -
40   !assert {model: crm.phonecall, id: crm_phonecall_interviewcall0}:
41      - opportunity_id != False
42       
43 - |
44   And I check that the phonecall and the newly created business opportunity is linked
45   to same  partner
46 -
47   !python {model:  crm.phonecall}: | 
48     obj_phonecall = self.browse(cr, uid, ref('crm_phonecall_interviewcall0'))
49     ids = self.pool.get('crm.lead').search(cr, uid, [('name', '=', obj_phonecall.opportunity_id.name)])
50     obj_opp = self.pool.get('crm.lead').browse(cr, uid, ids)[0]
51     assert obj_phonecall.partner_id == obj_opp.partner_id
52   
53 - |
54   I schedule Meeting on this current phonecall by clicking on "schedule
55   Meeting"
56 -
57    !python {model: crm.phonecall}: |
58      self.action_make_meeting(cr, uid, [ref('crm_phonecall_interviewcall0')])
59     
60 -  |
61    I can see that Meeting's calendar view is shown.
62    then I click on the date on which I want schedule meeting.
63    I fill proper data for that meeting and save it
64
65   !record {model: crm.meeting, id: crm_meeting_interviewcall0}:
66     alarm_id: base_calendar.alarm3
67     date: '2010-04-20 00:00:00'
68     date_deadline: '2010-04-20 08:00:00'
69     duration: 8.0
70     email_from: info@balmerinc.be
71     name: Interview call
72     partner_address_id: base.res_partner_address_1
73     partner_id: base.res_partner_9
74     phonecall_id: 'crm_phonecall_interviewcall0'
75     rrule_type: weekly
76     state: open
77   
78 - |
79   In order to schedule other phonecall to the partner
80   I click on "schedule other call" button. and plan for other call
81   I can see that it will open other phonecall view with some data same as current
82   phonecall.
83
84   !record {model: crm.phonecall2phonecall, id: crm_phonecall2phonecall_interviewcall0}:
85     date: '2010-04-21 19:49:00'
86     name: Interview call
87     section_id: crm.section_sales_department
88     user_id: base.user_root
89 - |
90   I click on "Schedule" button of this  wizard.    
91 -
92   !python {model: crm.phonecall2phonecall}: |
93     self.action_apply(cr, uid, [ref('crm_phonecall2phonecall_interviewcall0')], {'active_id': ref('crm_phonecall_interviewcall0')})