This commit enables eLearning users to share the channel linked to
certification they cleared directly from the result page.
Notes:
1 - We already have the option to share a certificate from the user info page
or from the slide page, and the same mechanism has been utilised here.
2 - With a recent commit[1], top padding was added to the modal opened on
website front-end to prevent modal overlapping the navbar. But it caused
a side effect on survey result page, where navbar is hidden. So we remove
this top padding on modal for the survey result page.
[1] - https://github.com/odoo/odoo/commit/6ef622772f7d0172553aca6dbce9eb71855460d7
taskId - 2337696
closes odoo/odoo#58104
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
23 lines
800 B
Python
23 lines
800 B
Python
# -*- coding: utf-8 -*-
|
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
|
|
from odoo.addons.survey.controllers import main
|
|
|
|
|
|
class Survey(main.Survey):
|
|
def _prepare_survey_finished_values(self, survey, answer, token=False):
|
|
result = super(Survey, self)._prepare_survey_finished_values(survey, answer, token)
|
|
if answer.slide_id:
|
|
result['channel_id'] = answer.slide_id.channel_id
|
|
|
|
return result
|
|
|
|
def _prepare_retry_additional_values(self, answer):
|
|
result = super(Survey, self)._prepare_retry_additional_values(answer)
|
|
if answer.slide_id:
|
|
result['slide_id'] = answer.slide_id.id
|
|
if answer.slide_partner_id:
|
|
result['slide_partner_id'] = answer.slide_partner_id.id
|
|
|
|
return result
|