Skip to content
Snippets Groups Projects
Commit 923c1eae authored by Goffin Simon's avatar Goffin Simon
Browse files

[FIX] survey: 403 Forbidden when printing survey


Steps to reproduce the bug:

- Let's consider a survey S
- Set the scoring option of S to Scoring without answers at the end
- print S

Bug:

A 403 error was raised.

opw:2307495

closes odoo/odoo#55556

X-original-commit: bb627bf8c182905adcf2bf9d9820c6e91dd44d26
Signed-off-by: default avatarSimon Goffin (sig) <sig@openerp.com>
parent 56523599
No related branches found
No related tags found
No related merge requests found
......@@ -548,14 +548,11 @@ class Survey(http.Controller):
survey_sudo, answer_sudo = access_data['survey_sudo'], access_data['answer_sudo']
if survey_sudo.scoring_type == 'scoring_without_answers':
return request.render("survey.survey_403_page", {'survey': survey_sudo})
return request.render('survey.survey_page_print', {
'is_html_empty': is_html_empty,
'review': review,
'survey': survey_sudo,
'answer': answer_sudo,
'answer': answer_sudo if survey_sudo.scoring_type != 'scoring_without_answers' else answer_sudo.browse(),
'questions_to_display': answer_sudo._get_print_questions(),
'scoring_display_correction': survey_sudo.scoring_type == 'scoring_with_answers' and answer_sudo,
'format_datetime': lambda dt: format_datetime(request.env, dt, dt_format=False),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment