[MERGE] forward port branch saas-14 up to b4799d0efb
This commit is contained in:
@@ -536,8 +536,8 @@ class Meeting(models.Model):
|
||||
|
||||
@api.multi
|
||||
def _get_recurrent_date_by_event(self, date_field='start'):
|
||||
""" Get recurrent dates based on Rule string and all event where recurrent_id is child
|
||||
|
||||
""" Get recurrent dates based on Rule string and all event where recurrent_id is child
|
||||
|
||||
date_field: the field containing the reference date information for recurrency computation
|
||||
"""
|
||||
self.ensure_one()
|
||||
@@ -720,7 +720,7 @@ class Meeting(models.Model):
|
||||
('weekly', 'Week(s)'),
|
||||
('monthly', 'Month(s)'),
|
||||
('yearly', 'Year(s)')
|
||||
], string='Recurrency', states={'done': [('readonly', True)]}, help="Let the event automatically repeat at that interval")
|
||||
], string='Recurrence', states={'done': [('readonly', True)]}, help="Let the event automatically repeat at that interval")
|
||||
recurrency = fields.Boolean('Recurrent', help="Recurrent Meeting")
|
||||
recurrent_id = fields.Integer('Recurrent ID')
|
||||
recurrent_id_date = fields.Datetime('Recurrent ID date')
|
||||
@@ -1262,8 +1262,6 @@ class Meeting(models.Model):
|
||||
meeting_origin = self.browse(real_id)
|
||||
|
||||
data = self.read(['allday', 'start', 'stop', 'rrule', 'duration'])[0]
|
||||
data['start_date' if data['allday'] else 'start_datetime'] = data['start']
|
||||
data['stop_date' if data['allday'] else 'stop_datetime'] = data['stop']
|
||||
if data.get('rrule'):
|
||||
data.update(
|
||||
values,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
import datetime
|
||||
|
||||
from odoo import fields
|
||||
from odoo.tests.common import TransactionCase
|
||||
@@ -97,3 +98,46 @@ class TestCalendar(TransactionCase):
|
||||
self.assertEqual(calendar_event_sprint_review.month_by, 'day', 'rrule_type should be mothly')
|
||||
self.assertEqual(calendar_event_sprint_review.byday, '1', 'rrule_type should be mothly')
|
||||
self.assertEqual(calendar_event_sprint_review.week_list, 'MO', 'rrule_type should be mothly')
|
||||
|
||||
def test_validation_error(self):
|
||||
"""
|
||||
Ideally this should build the base event in such a way that calling
|
||||
write() triggers detach_recurring_event, but I've no idea how that
|
||||
actually works so just calling it directly for now
|
||||
"""
|
||||
m = self.CalendarEvent.create({
|
||||
'name': "wheee",
|
||||
'start': '2017-07-12 14:30:00',
|
||||
'allday': False,
|
||||
'rrule': u'FREQ=WEEKLY;BYDAY=WE;INTERVAL=1;COUNT=100',
|
||||
'duration': 0.5,
|
||||
'stop': '2017-07-12 15:00:00',
|
||||
})
|
||||
|
||||
values = {
|
||||
'allday': False,
|
||||
'name': u'wheee',
|
||||
'attendee_ids': [
|
||||
(0, 0, {'state': u'needsAction', 'partner_id': 8, 'email': u'bob@example.com'}),
|
||||
(0, 0, {'state': u'needsAction', 'partner_id': 10, 'email': u'ed@example.com'}),
|
||||
],
|
||||
'recurrency': True,
|
||||
'privacy': u'public',
|
||||
'stop': '2017-07-10 16:00:00',
|
||||
'alarm_ids': [(6, 0, [])],
|
||||
'start': '2017-07-10 15:30:00',
|
||||
'location': u"XXX",
|
||||
'duration': 0.5,
|
||||
'partner_ids': [(4, 10), (4, 8)],
|
||||
'description': u"A thing"
|
||||
}
|
||||
|
||||
records = m.detach_recurring_event(values)
|
||||
self.assertEqual(
|
||||
(m.start_datetime, m.stop_datetime),
|
||||
(u'2017-07-12 14:30:00', u'2017-07-12 15:00:00'),
|
||||
)
|
||||
self.assertEquals(
|
||||
(records.start_datetime, records.stop_datetime),
|
||||
(u'2017-07-10 15:30:00', u'2017-07-10 16:00:00'),
|
||||
)
|
||||
|
||||
@@ -272,7 +272,7 @@ class LunchAlert(models.Model):
|
||||
alert_type = fields.Selection([('specific', 'Specific Day'),
|
||||
('week', 'Every Week'),
|
||||
('days', 'Every Day')],
|
||||
string='Recurrency', required=True, index=True, default='specific')
|
||||
string='Recurrence', required=True, index=True, default='specific')
|
||||
specific_day = fields.Date('Day', default=fields.Date.context_today)
|
||||
monday = fields.Boolean('Monday')
|
||||
tuesday = fields.Boolean('Tuesday')
|
||||
|
||||
@@ -358,7 +358,7 @@ class Slide(models.Model):
|
||||
record.embed_code = '<iframe src="//www.youtube.com/embed/%s?theme=light" allowFullScreen="true" frameborder="0"></iframe>' % (record.document_id)
|
||||
else:
|
||||
# embed google doc video
|
||||
record.embed_code = '<embed src="https://video.google.com/get_player?ps=docs&partnerid=30&docid=%s" type="application/x-shockwave-flash"></embed>' % (record.document_id)
|
||||
record.embed_code = '<iframe src="//drive.google.com/file/d/%s/preview" allowFullScreen="true" frameborder="0"></iframe>' % (record.document_id)
|
||||
else:
|
||||
record.embed_code = False
|
||||
|
||||
@@ -565,6 +565,7 @@ class Slide(models.Model):
|
||||
'name': snippet['title'],
|
||||
'image': self._fetch_data(snippet['thumbnails']['high']['url'], {}, 'image')['values'],
|
||||
'description': snippet['description'],
|
||||
'mime_type': False,
|
||||
})
|
||||
return {'values': values}
|
||||
|
||||
|
||||
@@ -344,7 +344,7 @@ Idiomatics Python Programming
|
||||
new_dict = dict(my_dict)
|
||||
new_list = list(old_list)
|
||||
|
||||
- Python dictionnary : creation and update
|
||||
- Python dictionary : creation and update
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
|
||||
Reference in New Issue
Block a user