-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: First approach Karma Tab functionality, for finishing quizze…
…s, leaving reviews
- Loading branch information
1 parent
3f72a51
commit 67e3c5d
Showing
9 changed files
with
69 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
.idea/ | ||
__pycache__/ | ||
odoo/custom-addons/wizelineacademy-academy-lms/eLearning_upgraded/__pycache__ | ||
eLearning_upgraded/__pycache__/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
from . import course_skills | ||
from . import slide_skill_tag | ||
from . import slide_skill_partner | ||
from . import slide_channel_extended | ||
from . import slide_channel_extended | ||
from . import slide_channel | ||
from . import slide_slide_partner |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from odoo import api, fields, models, _ | ||
|
||
class SlideChannel(models.Model): | ||
_inherit = 'slide.channel' | ||
|
||
karma_slide_complete = fields.Integer(string="Karma por completar contenido", default=5) | ||
karma_quiz_correct = fields.Integer(string="Karma por respuesta correcta", default=10) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from odoo import api, fields, models, _ | ||
|
||
class SlideSlidePartner(models.Model): | ||
_inherit = 'slide.slide.partner' | ||
|
||
@api.model_create_multi | ||
def create(self, vals_list): | ||
res = super(SlideSlidePartner, self).create(vals_list) | ||
for record in res: | ||
if record.completed: | ||
record._grant_karma_for_slide_completion() | ||
return res | ||
|
||
def write(self, values): | ||
res = super(SlideSlidePartner, self).write(values) | ||
if 'completed' in values and values['completed']: | ||
self._grant_karma_for_slide_completion() | ||
return res | ||
|
||
def _grant_karma_for_slide_completion(self): | ||
for record in self: | ||
user = record.partner_id.user_ids[:1] # Obtener el primer usuario asociado al partner | ||
if user: | ||
karma = record.channel_id.karma_slide_complete | ||
if karma > 0: | ||
user._add_karma( | ||
karma, | ||
source=record.slide_id, | ||
reason=_("Lección completada: %s" % record.slide_id.name) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<odoo> | ||
<record model="ir.ui.view" id="slide_channel_form_view_inherit_karma"> | ||
<field name="name">slide.channel.form.view.inherit.karma</field> | ||
<field name="model">slide.channel</field> | ||
<field name="inherit_id" ref="website_slides.view_slide_channel_form"/> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//page[@name='karma_rules']/group/group[field[@name='karma_gen_channel_rank']]" position="inside"> | ||
<field name="karma_slide_complete" string="Karma por completar contenido"/> | ||
<field name="karma_quiz_correct" string="Karma por respuesta correcta"/> | ||
</xpath> | ||
</field> | ||
</record> | ||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
[options] | ||
admin_passwd = 12345 | ||
db_host = False | ||
db_port = False | ||
db_user = aylin.reyes | ||
db_password = | ||
dbfilter = ^academy.*$ | ||
db_list = True | ||
addons_path = /Users/aylin.reyes/Documents/Odoo-community/odoo/addons,/Users/aylin.reyes/wizelineacademy-academy-lms | ||
db_user = alexadmin | ||
db_password = alexadmin | ||
db_name = odoo | ||
db_host = localhost | ||
db_port = 5432 | ||
admin_passwd = admin | ||
xmlrpc_port = 8069 | ||
addons_path = C:/Users/Alejandro/Odoo17/odoo/addons,C:\Users\Alejandro\Odoo17\odoo\custom-addons\wizelineacademy-academy-lms | ||
|