diff --git a/addons/calendar/models/calendar.py b/addons/calendar/models/calendar.py index 141101fe8269de4639abd9fc3e3df8801f8ec633..51181e0b0cf133c5a684bcdc600adf0af679b41d 100644 --- a/addons/calendar/models/calendar.py +++ b/addons/calendar/models/calendar.py @@ -535,8 +535,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() @@ -719,7 +719,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') @@ -1261,8 +1261,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, diff --git a/addons/calendar/tests/test_calendar.py b/addons/calendar/tests/test_calendar.py index 3604352ace5513e06e6b7c9082ecadf94a524a9f..6a2a035865e888a475f14e8dca1cd46b96e1a95a 100644 --- a/addons/calendar/tests/test_calendar.py +++ b/addons/calendar/tests/test_calendar.py @@ -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'), + ) diff --git a/addons/lunch/models/lunch.py b/addons/lunch/models/lunch.py index e175aae3d44a97ed248130294e7624cf406ce264..12fffdf6ce5fefa55212c6f8b57278aca1919a34 100644 --- a/addons/lunch/models/lunch.py +++ b/addons/lunch/models/lunch.py @@ -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') diff --git a/addons/website_slides/models/slides.py b/addons/website_slides/models/slides.py index 830cf910e8a8c93f5992b8f89fbb11bc9970f954..ad58b7af56a4e42ef10ea90e55390204eef8cd04 100644 --- a/addons/website_slides/models/slides.py +++ b/addons/website_slides/models/slides.py @@ -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} diff --git a/doc/reference/guidelines.rst b/doc/reference/guidelines.rst index 207faa082bbc50deb5bf02537748029e101713cb..77e2bce4461987441917495521a03a940902e08d 100644 --- a/doc/reference/guidelines.rst +++ b/doc/reference/guidelines.rst @@ -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