From 7e0ed740f38d035174d4c1258a372af38ea4f677 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Param=C3=A9s?= Date: Mon, 11 Aug 2014 11:32:45 +0100 Subject: [PATCH] [FIX] mail_thread: correctly handle single id argument in `unlink` fixes #1721 closes #1723 --- addons/mail/mail_thread.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py index 0dcfc6d5f68..eabd486d580 100644 --- a/addons/mail/mail_thread.py +++ b/addons/mail/mail_thread.py @@ -311,6 +311,9 @@ class mail_thread(osv.AbstractModel): cascaded, because link is done through (res_model, res_id). """ msg_obj = self.pool.get('mail.message') fol_obj = self.pool.get('mail.followers') + + if isinstance(ids, (int, long)): + ids = [ids] # delete messages and notifications msg_ids = msg_obj.search(cr, uid, [('model', '=', self._name), ('res_id', 'in', ids)], context=context) msg_obj.unlink(cr, uid, msg_ids, context=context)