[FIX] mail_thread: when the subtype does not exist anymore, avoid

crashing message_post; just ignore the subtype instead.

bzr revid: tde@openerp.com-20140410095143-05qpe3m2pbeg3fg5
This commit is contained in:
Thibault Delavallée
2014-04-10 11:51:43 +02:00
parent 107cc33d0e
commit ae1e7ed05e
+1 -2
View File
@@ -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: