diff --git a/addons/gamification/plan.py b/addons/gamification/plan.py index d40735c71bf..8df348b1af9 100644 --- a/addons/gamification/plan.py +++ b/addons/gamification/plan.py @@ -764,7 +764,7 @@ class gamification_goal_plan(osv.Model): def reward_user(self, cr, uid, user_id, badge_id, context=None): """Create a badge user and send the badge to him""" user_badge_id = self.pool.get('gamification.badge.user').create(cr, uid, {'user_id': user_id, 'badge_id': badge_id}, context=context) - return self.pool.get('gamification.badge').send_badge(cr, uid, badge_id, [user_badge_id], context=context) + return self.pool.get('gamification.badge').send_badge(cr, uid, badge_id, [user_badge_id], user_from=None, context=context) class gamification_goal_planline(osv.Model): diff --git a/addons/gamification/static/src/css/goal.css b/addons/gamification/static/src/css/goal.css index d8f4f7ca3fe..e481a800c79 100644 --- a/addons/gamification/static/src/css/goal.css +++ b/addons/gamification/static/src/css/goal.css @@ -107,12 +107,9 @@ .openerp .oe_mail_wall .oe_mail_wall_aside .oe_user_avatar { width: 32px; } +/* background progress bar */ .openerp .oe_mail_wall .oe_mail_wall_aside .oe_goal_progress { background: rgb(173, 219, 178); -/* background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3QQSDDgQbtbJfgAAABl0RVh0Q29tbWVudABDcmVhdGVkIHdpdGggR0lNUFeBDhcAAAAMSURBVAjXY2jY2AoAA2sBt0HZbqoAAAAASUVORK5CYII=); - background-image: url("http://lorempixel.com/20/10/"); - background-repeat: repeat-y; - background-position: 0 50%;*/ } .openerp .oe_mail_wall .oe_mail_wall_aside table progress,.oe_form_field_progressbar { width: 100%; diff --git a/addons/gamification/static/src/xml/gamification.xml b/addons/gamification/static/src/xml/gamification.xml index 29114897153..c6946d6397d 100644 --- a/addons/gamification/static/src/xml/gamification.xml +++ b/addons/gamification/static/src/xml/gamification.xml @@ -51,7 +51,7 @@ -
+
diff --git a/addons/hr_gamification/gamification.py b/addons/hr_gamification/gamification.py index 3d07ca1b4f8..bbda1e23ab1 100644 --- a/addons/hr_gamification/gamification.py +++ b/addons/hr_gamification/gamification.py @@ -141,7 +141,13 @@ class hr_employee(osv.osv): """Return the list of badge_users assigned to the employee""" res = {} for employee in self.browse(cr, uid, ids, context=context): - res[employee.id] = self.pool.get('gamification.badge.user').search(cr, uid, [('employee_id', '=', employee.id)], context=context) + res[employee.id] = self.pool.get('gamification.badge.user').search(cr, uid, [ + '|', + ('employee_id', '=', employee.id), + '&', + ('employee_id', '=', False), + ('user_id', '=', employee.user_id.id) + ], context=context) return res def _has_badges(self, cr, uid, ids, field_name, arg, context=None):