2012-08-13 12:31:11 +00:00
-
In Order to test base_calendar, I will first create One Simple Event with real data
2010-04-20 12:58:48 +00:00
-
!record {model: calendar.event, id: calendar_event_technicalpresentation0}:
class : private
2011-01-13 17:02:41 +00:00
date : '2011-04-30 16:00:00'
date_deadline : '2011-04-30 18:30:00'
2010-04-20 12:58:48 +00:00
description : The Technical Presentation will cover following topics:\n* Creating OpenERP
class\n* Views\n* Wizards\n* Workflows
duration : 2.5
location : OpenERP S.A.
name : Technical Presentation
rrule_type : none
2012-08-13 12:31:11 +00:00
-
Now I will set recurrence for this event to occur monday and friday of week
2010-04-20 12:58:48 +00:00
-
!python {model: calendar.event}: |
2011-10-20 15:08:58 +00:00
data = {'fr': 1, 'mo': 1, 'interval': 1, 'rrule_type': 'weekly', 'end_type': 'end_date', 'end_date': '2011-05-31 00:00:00', 'recurrency' : True}
2011-04-13 09:26:26 +00:00
self.write(cr, uid, [ref("calendar_event_technicalpresentation0")], data)
2012-08-13 12:31:11 +00:00
-
In order to check that recurrent events are views successfully in calendar view, I will open calendar view of events
2010-04-20 12:58:48 +00:00
-
!python {model: calendar.event}: |
self.fields_view_get(cr, uid, False, 'calendar', context)
2012-08-13 12:31:11 +00:00
-
In order to check that recurrent events are views successfully in calendar view, I will search for one of the recurrent event and count the number of events
2010-04-20 12:58:48 +00:00
-
!python {model: calendar.event}: |
2011-04-13 09:26:26 +00:00
ids = self.search(cr, uid, [('date', '>=', '2011-04-30 16:00:00'), ('date', '<=', '2011-05-31 00:00:00')], context={'virtual_id': True} )
2011-01-06 05:36:08 +00:00
assert len(ids) == 9
2012-08-13 12:31:11 +00:00
-
Now I will make All day event and test it
2010-04-20 12:58:48 +00:00
-
!record {model: calendar.event, id: calendar_event_alldaytestevent0}:
allday : 1
class : confidential
2011-01-13 17:02:41 +00:00
date : '2011-04-30 00:00:00'
date_deadline : '2011-04-30 00:00:00'
2010-04-20 12:58:48 +00:00
description : 'All day technical test '
location : School
name : All day test event
rrule_type : none
2012-08-13 12:31:11 +00:00
-
In order to check reminder I will first create reminder
2010-04-20 12:58:48 +00:00
-
!record {model: res.alarm, id: res_alarm_daybeforeeventstarts0}:
name : 1 Day before event starts
trigger_duration : 1
trigger_interval : days
trigger_occurs : before
trigger_related : start
2012-08-13 12:31:11 +00:00
-
Now I will assign this reminder to all day event
2010-04-20 12:58:48 +00:00
-
!python {model: calendar.event}: |
self.write(cr, uid, [ref("calendar_event_alldaytestevent0")], {'alarm_id': ref("res_alarm_daybeforeeventstarts0")})
2012-08-13 12:31:11 +00:00
-
In order to assign attendee I will invite Demo user
2010-04-20 12:58:48 +00:00
-
!record {model: base_calendar.invite.attendee, id: base_calendar_invite_attendee_0}:
type : internal
2010-09-06 05:21:13 +00:00
send_mail : False
2010-04-20 12:58:48 +00:00
partner_id : base.res_partner_9 # Put bcz of problem in read
user_ids :
- base.user_demo
2012-08-13 12:31:11 +00:00
-
Then I click on Invite Button
2010-04-20 12:58:48 +00:00
-
!python {model: base_calendar.invite.attendee}: |
self.do_invite(cr, uid, [ref("base_calendar_invite_attendee_0")], {'active_id': ref("calendar_event_alldaytestevent0"), 'model' : 'calendar.event', 'attendee_field':'attendee_ids'})
2012-08-13 12:31:11 +00:00
-
Now I will Accept this invitation
2010-04-20 12:58:48 +00:00
-
!python {model: calendar.attendee}: |
ids = self.search(cr, uid, [('ref', '=', 'calendar.event' + ',' + str(ref("calendar_event_alldaytestevent0")))])
if ids :
self.do_accept(cr, uid, ids, context=context)