Files
odoo_source/addons/website_forum/models/gamification.py
T
Parth Gajjar 893d7fa864 [MIGRATE] website_forum: migration to the new API, cleaning and linting of models and controllers.
Main cleaning
- remove introduction_message, introduced in saas-6 with inboung forum, that was quite
a duplicate of description.
- renamed relevancy_option_first and relevancy_option_second, introduced in saas-4
with inbound forum
- renamed type of post to post_type to avoid confusion with the type keyword
- some cleaning in templates
2014-11-04 15:59:55 +01:00

31 lines
798 B
Python

# -*- coding: utf-8 -*-
from openerp import models, fields, api
class gamification_challenge(models.Model):
_inherit = 'gamification.challenge'
@api.model
def _get_categories(self):
res = super(gamification_challenge, self)._get_categories()
res.append(('forum', 'Website / Forum'))
return res
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)