Skip to content

Commit

Permalink
[ADD] website_profile: new module holding website-related code for ga…
Browse files Browse the repository at this point in the history
…mification

Purpose is to be able to re-use frontend-related model, data and tools
for gamification. Currently only forum uses gamification. Soon slides module
will use them and user profile / biography will be expanded. This commit
prepares those features by already preparing the bridge module and adding
a publish option on badges.

Partial commit linked to eLearning project. Main specifications related
to gamification and user profile can be found on task 1922159 (PR odoo#30514).
Main specifications related to eLearning can be found on task 1902304
(PR odoo#29876).

Co-Authored-By: David Beguin <dbe@odoo.com>
Co-Authored-By: Thibault Delavallee <tde@odoo.com>
  • Loading branch information
tde-banana-odoo and dbeguin committed Feb 7, 2019
1 parent d400590 commit 10b8bad
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 2 deletions.
4 changes: 2 additions & 2 deletions addons/website_forum/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
'website': 'https://www.odoo.com/page/community-builder',
'depends': [
'auth_signup',
'gamification',
'website_mail',
'website_partner'
'website_partner',
'website_profile',
],
'data': [
'data/forum_data.xml',
Expand Down
4 changes: 4 additions & 0 deletions addons/website_profile/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.

from . import models
19 changes: 19 additions & 0 deletions addons/website_profile/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.

{
'name': 'Website profile',
'category': 'Hidden',
'version': '1.0',
'summary': 'Access the website profile of the users',
'description': """Allows to acces the website profile of the users and see their statistics (karma, badges, etc..)""",
'depends': [
'website',
'gamification'
],
'data': [
'views/gamification_badge_views.xml',
'security/ir.model.access.csv',
],
'auto_install': False,
}
4 changes: 4 additions & 0 deletions addons/website_profile/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.

from . import gamification_badge
9 changes: 9 additions & 0 deletions addons/website_profile/models/gamification_badge.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.

from odoo import models


class GamificationBadge(models.Model):
_name = 'gamification.badge'
_inherit = ['gamification.badge', 'website.published.mixin']
2 changes: 2 additions & 0 deletions addons/website_profile/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink
gamification_karma_rank_access_website_publisher,gamification.karma.rank.access.website.publisher,gamification.model_gamification_karma_rank,website.group_website_publisher,1,1,1,1
16 changes: 16 additions & 0 deletions addons/website_profile/views/gamification_badge_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<record id="gamification_badge_view_form" model="ir.ui.view">
<field name="name">gamification.badge.view.form.inherit.website</field>
<field name="model">gamification.badge</field>
<field name="inherit_id" ref="gamification.badge_form_view"/>
<field name="arch" type="xml">
<xpath expr="//div[@name='button_box']" position="inside">
<button class="oe_stat_button" name="website_publish_button"
type="object" icon="fa-globe">
<field name="is_published" widget="website_button"/>
</button>
</xpath>
</field>
</record>
</odoo>

0 comments on commit 10b8bad

Please sign in to comment.