Files
odoo_source/addons/website_forum/models/gamification.py
T
Xavier Morel 0c649644db [MIG] gamification: Migrate to new API
Includes compatibility-change to website_forum: a selection(callable)
converted to a Selection(list) since that can easily be extended in the
new API.
2016-08-05 10:18:02 +02:00

26 lines
680 B
Python

# -*- coding: utf-8 -*-
from openerp import models, fields, api
class Challenge(models.Model):
_inherit = 'gamification.challenge'
category = fields.Selection(selection_add=[('forum', 'Website / Forum')])
class Badge(models.Model):
_inherit = 'gamification.badge'
level = fields.Selection([('bronze', 'bronze'), ('silver', 'silver'), ('gold', 'gold')], string='Forum Badge Level')
class UserBadge(models.Model):
_inherit = 'gamification.badge.user'
level = fields.Selection(
[('bronze', 'bronze'),
('silver', 'silver'),
('gold', 'gold')],
string='Forum Badge Level',
related="badge_id.level", store=True)