9b89fff697bb54a21ee412e6f4c1f3359da9bd95
[odoo/odoo.git] / addons / crm / test / test_crm_meeting.yml
1 - |
2   Now I will test Meetings which may be customer meeting or phonecall meeting or
3   internal Meeting.
4 - |
5   I start by creating a new Meeting.     
6
7   !record {model: crm.meeting, id: crm_meeting_regardingpresentation0}:
8     categ_id: crm.categ_meet2
9     date: !eval time.strftime('%Y-%m-%d 16:04:00')
10     date_deadline: !eval "(datetime.now() + timedelta(1)).strftime('%Y-%m-%d 00:04:00')"
11     duration: 8.0
12     email_from: info@balmerinc.be
13     location: Ahmedabad
14     name: Regarding Presentation
15     partner_address_id: base.res_partner_address_1
16     partner_id: base.res_partner_9
17     rrule_type: weekly
18     section_id: crm.section_sales_department
19 - |
20   I check that the Meetings is in 'UnConfirmed' state.
21 -       
22   !assert {model: crm.meeting, id: crm_meeting_regardingpresentation0}:
23      - state == "draft" 
24 - |
25   I can set reminder on meeting if I put reminder "40 minutes before" 
26 - |
27   For that, I first create alarm.
28
29   !record {model: res.alarm, id: res_alarm_minituesbefore0}:
30     name: 40 minutes before
31     trigger_duration: 40
32     trigger_interval: minutes
33     trigger_occurs: before
34     trigger_related: start
35 - |
36   Now I will assign this reminder. 
37   
38 - !python {model: crm.meeting}: |
39      self.write(cr, uid, [ref('crm_meeting_regardingpresentation0')], {'alarm_id': ref("res_alarm_minituesbefore0")})
40 - |
41   In order to check recurrence on meetings I will set Recurrency to Custom
42   and I set the fields so that the meeting will occur weekly on Monday and Friday 10 times
43 -
44   !python {model: crm.meeting}: |
45      self.write(cr, uid, [ref("crm_meeting_regardingpresentation0")], {'fr': 1, 'mo': 1, 'th': 1, 'tu': 1, 'we':1,   'count':10, 'interval': 1, 'rrule_type': 'weekly'})
46       
47 - |
48   I can see from the calendar view that the meeting is scheduled on Monday and Friday
49   for 10 times,
50   
51 -
52   !python {model: crm.meeting}: |
53     self.fields_view_get(cr, uid, False, 'calendar', context)
54 - | 
55   I will search for one of the recurrent event and count the number of meeting.
56 -
57   !python {model: crm.meeting}: |
58      import time
59      from datetime import datetime, date, timedelta
60      ids = self.search(cr, uid, [('date', '>=', time.strftime('%Y-%m-%d 00:00:00')), ('date', '<=', (datetime.now()+timedelta(31)).strftime('%Y-%m-%d 00:00:00')), ('name', '=', 'Regarding Presentation')], context={'virtual_id': True})
61      assert len(ids) == 10      
62
63 - |
64   Now If I want to edit meetings information for all occurrence I click on "Edit All" button.
65 -
66   !python {model: crm.meeting}: |
67      self.write(cr, uid, [ref('crm_meeting_regardingpresentation0')], {'edit_all':'True'},context)
68 - |   
69   I can see that new meeting form is opened with same value
70   I change some data for meeting and save it
71   I can see from meeting's calendar view that all meeting occurrences are changed accordingly
72
73   !record {model: crm.meeting, id: crm.crm_meeting_regardingpresentation0}:
74     alarm_id: base_calendar.alarm9
75     rrule_type: weekly
76
77 - | 
78   In order to invite people for this meetings, I click on "Invite People" button
79   I can invite internal user. 
80
81   !record {model: base_calendar.invite.attendee, id: base_calendar_invite_attendee_0}:
82     type: internal
83     send_mail: False
84     partner_id: base.res_partner_9
85     user_ids:
86       - base.user_demo
87 -
88   I click on "Invite" button of "Invite attendee" wizard.    
89 -
90   !python {model: base_calendar.invite.attendee}: |
91     self.do_invite(cr, uid, [ref('base_calendar_invite_attendee_0')], {'active_id': ref('crm_meeting_regardingpresentation0'), 'model' : 'crm.meeting', 'attendee_field':'attendee_ids'}) 
92
93 - |
94   After direct/indirect confirmation for meetings I can confirm meeting   
95 -
96   !python {model: crm.meeting}: |
97     self.case_open(cr, uid, [ref('crm_meeting_regardingpresentation0')])