[FIX] Fixed bug with message dict not necessarily containing a 'type' entry

bzr revid: tde@openerp.com-20120210095348-z8m7gqpse6hw9byr
This commit is contained in:
Thibault Delavallée
2012-02-10 10:53:48 +01:00
parent 9efc4714f2
commit 1d09919c18
+1 -1
View File
@@ -198,7 +198,7 @@ class mail_message(osv.osv):
def create(self, cr, uid, vals, context=None):
# OpenSocial: notifications do not come from any user but from system
if vals['type'] == 'notification': vals['user_id'] = False
if vals.get('type') == 'notification': vals['user_id'] = False
need_action_pushed = False
msg_id = super(mail_message, self).create(cr, uid, vals, context)
# push the message to suscribed users