[REF] remove public attributes for badges

bzr revid: mat@openerp.com-20130411102418-vp9wng9ryzzggcgo
This commit is contained in:
Martin Trigaux 2013-04-11 12:24:18 +02:00
parent cff925cf3e
commit d20cbcf9f4
3 changed files with 2 additions and 6 deletions

View File

@ -176,8 +176,6 @@ class gamification_badge(osv.Model):
string='Goals Linked',
help="The users that have succeeded theses goals will receive automatically the badge."),
'public': fields.boolean('Public',
help="A message will be posted on the user profile or just sent to him"),
'owner_ids': fields.one2many('gamification.badge.user', 'badge_id',
string='Owners', help='The list of instances of this badge granted to users'),
'unique_owner_ids': fields.function(_get_unique_global_list,
@ -206,8 +204,7 @@ class gamification_badge(osv.Model):
'stat_this_month': 0,
'rule_auth': 'everyone',
'rule_automatic': 'manual',
'compute_code': "self.nobody(cr, uid, context)",
'public': True
'compute_code': "self.nobody(cr, uid, context)"
}
def send_badge(self, cr, uid, badge_id, badge_user_ids, user_from=None, context=None):

View File

@ -86,7 +86,6 @@
</div>
<group>
<field name="description" />
<field name="public" />
</group>
<group string="User Rules">
<field name="rule_auth" string="Allowed to Grant" />

View File

@ -55,7 +55,7 @@ class hr_gamification_badge(osv.Model):
if 'badge_user' in context and 'badge_id' in context:
badge = self.browse(cr, uid, context['badge_id'], context=context)
badge_user = context['badge_user']
if badge.public and badge_user.employee_id:
if badge_user.employee_id:
return self.pool.get('hr.employee').message_post(cr, uid,
badge_user.employee_id.id, context=context, **kwargs)
return super(hr_gamification_badge, self).message_post(cr, uid, thread_id, context=context, **kwargs)