diff options
| author | André Paramés <git@andreparames.com> | 2014-08-11 11:32:45 +0100 |
|---|---|---|
| committer | Denis Ledoux <dle@odoo.com> | 2015-06-26 15:25:02 +0200 |
| commit | 7e0ed740f38d035174d4c1258a372af38ea4f677 (patch) | |
| tree | 471eb3742464784076aab509ae566102d621f18f | |
| parent | 831fbd01f7873a80732b6f0f8f3d949f72230296 (diff) | |
[FIX] mail_thread: correctly handle single id argument in `unlink`
fixes #1721
closes #1723
| -rw-r--r-- | addons/mail/mail_thread.py | 3 |
1 files changed, 3 insertions, 0 deletions
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) |
