From e2dc6b782d844c8cbfa85ce34b16f3ed588055f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Fri, 11 Apr 2014 16:22:14 +0200 Subject: [PATCH] [FIX] mail: avoid crashing message_post if the subtype does not exists anymore. Using xmlid_to_res_id, subtype_id will be False if not found. bzr revid: tde@openerp.com-20140411142214-nvvgkduzv51cc2eg --- addons/mail/mail_thread.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py index f2d33be7787..73588207d6a 100644 --- a/addons/mail/mail_thread.py +++ b/addons/mail/mail_thread.py @@ -1511,8 +1511,7 @@ class mail_thread(osv.AbstractModel): if subtype: if '.' not in subtype: subtype = 'mail.%s' % subtype - ref = self.pool.get('ir.model.data').get_object_reference(cr, uid, *subtype.split('.')) - subtype_id = ref and ref[1] or False + subtype_id = self.pool.get('ir.model.data').xmlid_to_res_id(cr, uid, subtype) # automatically subscribe recipients if asked to if context.get('mail_post_autofollow') and thread_id and partner_ids: