diff options
| author | Christophe Simonis <chs@odoo.com> | 2019-05-09 21:07:44 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2019-05-09 21:07:44 +0200 |
| commit | cc3a2c1bf3c8aa2a7f85b5c2f8eb4e9415f3e6c7 (patch) | |
| tree | f97b6171e54f052126a1fad2f55a33c603e18bef /addons/calendar/models | |
| parent | 92cb648882082cc8d84d3bbe75304def5196998c (diff) | |
| parent | e11bacfe512a3170f44d6d43646af914a9cf3b73 (diff) | |
[MERGE] forward port branch 12.0 up to e11bacfe512
Diffstat (limited to 'addons/calendar/models')
| -rw-r--r-- | addons/calendar/models/calendar.py | 5 | ||||
| -rw-r--r-- | addons/calendar/models/mail_message.py | 3 |
2 files changed, 4 insertions, 4 deletions
diff --git a/addons/calendar/models/calendar.py b/addons/calendar/models/calendar.py index 4d76e598d43..876e48698d0 100644 --- a/addons/calendar/models/calendar.py +++ b/addons/calendar/models/calendar.py @@ -409,8 +409,9 @@ class AlarmManager(models.AbstractModel): all_meetings = self.get_next_potential_limit_alarm('notification', partner_id=partner.id) time_limit = 3600 * 24 # return alarms of the next 24 hours - for meeting in self.env['calendar.event'].search([('id', 'in', list(all_meetings))]): # cannot browse - max_delta = all_meetings[meeting.id]['max_duration'] + for event_id in all_meetings: + max_delta = all_meetings[event_id]['max_duration'] + meeting = self.env['calendar.event'].browse(event_id) if meeting.recurrency: b_found = False last_found = False diff --git a/addons/calendar/models/mail_message.py b/addons/calendar/models/mail_message.py index 143bea2d135..58ac99e2825 100644 --- a/addons/calendar/models/mail_message.py +++ b/addons/calendar/models/mail_message.py @@ -26,7 +26,6 @@ class Message(models.Model): def _find_allowed_model_wise(self, doc_model, doc_dict): if doc_model == 'calendar.event': order = self._context.get('order', self.env[doc_model]._order) - records = self.env[doc_model].search([('id', 'in', list(doc_dict))]) - for virtual_id in records.get_recurrent_ids([], order=order): + for virtual_id in self.env[doc_model].with_context(active_test=False).search([('id', 'in', list(doc_dict))], order=order).ids: doc_dict.setdefault(virtual_id, doc_dict[get_real_ids(virtual_id)]) return super(Message, self)._find_allowed_model_wise(doc_model, doc_dict) |
