From d0740bedb99f15c26c0aab611043b2fbe6bb52c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Fri, 11 Apr 2014 19:57:30 +0200 Subject: [PATCH] [IMP] gamification: messages posted on user when receiving a badge now have a subtype, to ease their search. bzr revid: tde@openerp.com-20140411175730-hq06b7qezurzymj6 --- addons/gamification/data/badge.xml | 11 ++++++++++- addons/gamification/models/badge.py | 7 ++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/addons/gamification/data/badge.xml b/addons/gamification/data/badge.xml index 5a390be9deb..33d02bf016e 100644 --- a/addons/gamification/data/badge.xml +++ b/addons/gamification/data/badge.xml @@ -23,7 +23,6 @@ - Brilliant With your brilliant ideas, you are an inspiration to others. @@ -32,6 +31,16 @@ 2 + + + + Badge Granted + res.users + + + Badge Granted + + diff --git a/addons/gamification/models/badge.py b/addons/gamification/models/badge.py index 4ecc116000c..d8a3ef18840 100644 --- a/addons/gamification/models/badge.py +++ b/addons/gamification/models/badge.py @@ -63,7 +63,12 @@ class gamification_badge_user(osv.Model): template_id = self.pool['ir.model.data'].get_object(cr, uid, 'gamification', 'email_template_badge_received', context) for badge_user in self.browse(cr, uid, ids, context=context): body_html = temp_obj.render_template(cr, uid, template_id.body_html, 'gamification.badge.user', badge_user.id, context=context) - res = user_obj.message_post(cr, uid, badge_user.user_id.id, body=body_html, partner_ids=[badge_user.user_id.partner_id.id], context=context) + res = user_obj.message_post( + cr, uid, badge_user.user_id.id, + body=body_html, + subtype='gamification.mt_badge_granted', + partner_ids=[badge_user.user_id.partner_id.id], + context=context) return res def create(self, cr, uid, vals, context=None):