[MERGE] forward port branch saas-15 up to 729cf0e17d
This commit is contained in:
@@ -545,8 +545,8 @@ class Meeting(models.Model):
|
|||||||
|
|
||||||
@api.multi
|
@api.multi
|
||||||
def _get_recurrent_date_by_event(self, date_field='start'):
|
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
|
date_field: the field containing the reference date information for recurrency computation
|
||||||
"""
|
"""
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
@@ -729,7 +729,7 @@ class Meeting(models.Model):
|
|||||||
('weekly', 'Week(s)'),
|
('weekly', 'Week(s)'),
|
||||||
('monthly', 'Month(s)'),
|
('monthly', 'Month(s)'),
|
||||||
('yearly', 'Year(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")
|
recurrency = fields.Boolean('Recurrent', help="Recurrent Meeting")
|
||||||
recurrent_id = fields.Integer('Recurrent ID')
|
recurrent_id = fields.Integer('Recurrent ID')
|
||||||
recurrent_id_date = fields.Datetime('Recurrent ID date')
|
recurrent_id_date = fields.Datetime('Recurrent ID date')
|
||||||
@@ -1258,8 +1258,6 @@ class Meeting(models.Model):
|
|||||||
meeting_origin = self.browse(real_id)
|
meeting_origin = self.browse(real_id)
|
||||||
|
|
||||||
data = self.read(['allday', 'start', 'stop', 'rrule', 'duration'])[0]
|
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'):
|
if data.get('rrule'):
|
||||||
data.update(
|
data.update(
|
||||||
values,
|
values,
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||||
|
import datetime
|
||||||
|
|
||||||
from odoo import fields
|
from odoo import fields
|
||||||
from odoo.tests.common import TransactionCase
|
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.byday, '1', 'rrule_type should be mothly')
|
||||||
self.assertEqual(calendar_event_sprint_review.week_list, 'MO', '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):
|
def test_event_order(self):
|
||||||
""" check the ordering of events when searching """
|
""" check the ordering of events when searching """
|
||||||
def create_event(name, date):
|
def create_event(name, date):
|
||||||
|
|||||||
@@ -276,7 +276,7 @@ class LunchAlert(models.Model):
|
|||||||
alert_type = fields.Selection([('specific', 'Specific Day'),
|
alert_type = fields.Selection([('specific', 'Specific Day'),
|
||||||
('week', 'Every Week'),
|
('week', 'Every Week'),
|
||||||
('days', 'Every Day')],
|
('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)
|
specific_day = fields.Date('Day', default=fields.Date.context_today)
|
||||||
monday = fields.Boolean('Monday')
|
monday = fields.Boolean('Monday')
|
||||||
tuesday = fields.Boolean('Tuesday')
|
tuesday = fields.Boolean('Tuesday')
|
||||||
|
|||||||
@@ -154,7 +154,7 @@
|
|||||||
type="action" context="{'default_advance_payment_method': 'percentage'}"
|
type="action" context="{'default_advance_payment_method': 'percentage'}"
|
||||||
attrs="{'invisible': ['|',('invoice_status', '!=', 'no'), ('state', '!=', 'sale')]}"/>
|
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" 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="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="sent" string="Confirm Sale" class="btn-primary" type="object" />
|
||||||
<button name="action_confirm" states="draft" string="Confirm Sale" type="object" />
|
<button name="action_confirm" states="draft" string="Confirm Sale" type="object" />
|
||||||
|
|||||||
@@ -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)
|
record.embed_code = '<iframe src="//www.youtube.com/embed/%s?theme=light" allowFullScreen="true" frameborder="0"></iframe>' % (record.document_id)
|
||||||
else:
|
else:
|
||||||
# embed google doc video
|
# 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:
|
else:
|
||||||
record.embed_code = False
|
record.embed_code = False
|
||||||
|
|
||||||
@@ -565,6 +565,7 @@ class Slide(models.Model):
|
|||||||
'name': snippet['title'],
|
'name': snippet['title'],
|
||||||
'image': self._fetch_data(snippet['thumbnails']['high']['url'], {}, 'image')['values'],
|
'image': self._fetch_data(snippet['thumbnails']['high']['url'], {}, 'image')['values'],
|
||||||
'description': snippet['description'],
|
'description': snippet['description'],
|
||||||
|
'mime_type': False,
|
||||||
})
|
})
|
||||||
return {'values': values}
|
return {'values': values}
|
||||||
|
|
||||||
|
|||||||
@@ -344,7 +344,7 @@ Idiomatics Python Programming
|
|||||||
new_dict = dict(my_dict)
|
new_dict = dict(my_dict)
|
||||||
new_list = list(old_list)
|
new_list = list(old_list)
|
||||||
|
|
||||||
- Python dictionnary : creation and update
|
- Python dictionary : creation and update
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user