From d13ca06c8eeaddf5c3050afaa829d50225b7d249 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Mon, 23 Feb 2015 14:25:07 +0100 Subject: [PATCH] [FIX] calendar: message_(un)subscribe expects integers In calendar, using recurrent events leads to the use of virtual ids, which are strings. It wasn't possible to change the message subscriptions for recurring events, neither for the user himself, neither for the other followers opw-627895 --- addons/calendar/calendar.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/calendar/calendar.py b/addons/calendar/calendar.py index 9250e1a2a1c..28edd84426b 100644 --- a/addons/calendar/calendar.py +++ b/addons/calendar/calendar.py @@ -1416,6 +1416,12 @@ class calendar_event(osv.Model): del context['default_date'] return super(calendar_event, self).message_post(cr, uid, thread_id, body=body, subject=subject, type=type, subtype=subtype, parent_id=parent_id, attachments=attachments, context=context, **kwargs) + def message_subscribe(self, cr, uid, ids, partner_ids, subtype_ids=None, context=None): + return super(calendar_event, self).message_subscribe(cr, uid, get_real_ids(ids), partner_ids, subtype_ids=subtype_ids, context=context) + + def message_unsubscribe(self, cr, uid, ids, partner_ids, context=None): + return super(calendar_event, self).message_unsubscribe(cr, uid, get_real_ids(ids), partner_ids, context=context) + def do_sendmail(self, cr, uid, ids, context=None): for event in self.browse(cr, uid, ids, context): current_user = self.pool['res.users'].browse(cr, uid, uid, context=context) @@ -1747,7 +1753,6 @@ class calendar_event(osv.Model): return res - class mail_message(osv.Model): _inherit = "mail.message"