diff --git a/addons/calendar/models/calendar.py b/addons/calendar/models/calendar.py index 67a36022dacfeb7cc85250b2e7e4424133cf8efc..69415976574b5876a0ac842c3abe827950b1b533 100644 --- a/addons/calendar/models/calendar.py +++ b/addons/calendar/models/calendar.py @@ -545,8 +545,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() @@ -729,7 +729,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') @@ -1258,8 +1258,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 0b986f18bb3d47e3a50945c493d4c21d5f9993d1..e34aaec376ccccf326d37c14d439d778db6d93b4 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 @@ -98,6 +99,49 @@ class TestCalendar(TransactionCase): 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'), + ) + def test_event_order(self): """ check the ordering of events when searching """ def create_event(name, date): diff --git a/addons/lunch/models/lunch.py b/addons/lunch/models/lunch.py index e4c634a16492e1fc2a99f6c8be1efaee83a5cfe5..79a48e915a8ba8a62559a6ffff204eb0f1896562 100644 --- a/addons/lunch/models/lunch.py +++ b/addons/lunch/models/lunch.py @@ -276,7 +276,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/sale/views/sale_views.xml b/addons/sale/views/sale_views.xml index 69a5b997651b02206f422b43cf8c867fc5ef0fff..872d1890ee5196d4c1dbe60d2764a18fea2d35c3 100644 --- a/addons/sale/views/sale_views.xml +++ b/addons/sale/views/sale_views.xml @@ -154,7 +154,7 @@ type="action" context="{'default_advance_payment_method': 'percentage'}" attrs="{'invisible': ['|',('invoice_status', '!=', 'no'), ('state', '!=', 'sale')]}"/> <button name="action_quotation_send" string="Send by Email" type="object" states="draft" class="btn-primary"/> - <button name="action_quotation_send" type="object" string="Send PRO-FORMA" groups="sale.group_proforma_sales" class="btn-primary" attrs="{'invisible': ['|', ('state', 'in', ['sent', 'sale']), ('invoice_count','>=',1)]}" context="{'proforma': True}"/> + <button name="action_quotation_send" type="object" string="Send PRO-FORMA" groups="sale.group_proforma_sales" class="btn-primary" attrs="{'invisible': ['|', ('state', '!=', 'draft'), ('invoice_count','>=',1)]}" context="{'proforma': True}"/> <button name="print_quotation" string="Print" type="object" states="draft" class="btn-primary o_sale_print"/> <button name="action_confirm" states="sent" string="Confirm Sale" class="btn-primary" type="object" /> <button name="action_confirm" states="draft" string="Confirm Sale" type="object" /> 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