[REVIEW] [CLEAN] gamification: reverted changes instead of
authorThibault Delavallée <tde@openerp.com>
Wed, 9 Apr 2014 15:26:29 +0000 (17:26 +0200)
committerThibault Delavallée <tde@openerp.com>
Wed, 9 Apr 2014 15:26:29 +0000 (17:26 +0200)
the fix.

bzr revid: tde@openerp.com-20140409152629-3div4vdfknjrtnb6

addons/gamification/models/badge.py

index cf8b1fc..102892a 100644 (file)
@@ -34,7 +34,6 @@ class gamification_badge_user(osv.Model):
 
     _name = 'gamification.badge.user'
     _description = 'Gamification user badge'
-    _inherit = ['mail.thread']
     _order = "create_date desc"
     _rec_name = "badge_name"
 
@@ -59,6 +58,7 @@ class gamification_badge_user(osv.Model):
         """
         res = True
         temp_obj = self.pool.get('email.template')
+        user_obj = self.pool.get('res.users')
         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)
@@ -66,9 +66,8 @@ class gamification_badge_user(osv.Model):
         return res
 
     def create(self, cr, uid, vals, context=None):
-        create_context = dict(context, mail_create_nolog=True)
         self.pool.get('gamification.badge').check_granting(cr, uid, badge_id=vals.get('badge_id'), context=context)
-        return super(gamification_badge_user, self).create(cr, uid, vals, context=create_context)
+        return super(gamification_badge_user, self).create(cr, uid, vals, context=context)
 
 
 class gamification_badge(osv.Model):