From 926bf780b95b4e981c4149e4182083b802e7830f Mon Sep 17 00:00:00 2001 From: Hetal Dhanak Date: Fri, 12 Apr 2019 11:10:14 +0000 Subject: [PATCH] [IMP] survey: hide retry button on print view -Previously, The Retry button was visible on printable view of the survey as well as on answers. -This commit fixes the issue by passing an extra parameter to determine whether user is in printable view or simply in answer review. Task: 1967500 closes odoo/odoo#32618 Signed-off-by: Thibault Delavallee (tde) --- addons/survey/controllers/main.py | 3 ++- addons/survey/views/survey_templates.xml | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/addons/survey/controllers/main.py b/addons/survey/controllers/main.py index 770a8c20a1d..56f00eb287c 100644 --- a/addons/survey/controllers/main.py +++ b/addons/survey/controllers/main.py @@ -426,7 +426,7 @@ class Survey(http.Controller): return json.dumps(ret) @http.route('/survey/print/', type='http', auth='public', website=True) - def survey_print(self, survey_token, answer_token=None, **post): + def survey_print(self, survey_token, review=False, answer_token=None, **post): '''Display an survey in printable view; if is set, it will grab the answers of the user_input_id that has .''' access_data = self._get_access_data(survey_token, answer_token, ensure_token=False) @@ -441,6 +441,7 @@ class Survey(http.Controller): return request.render("survey.403", {'survey': survey_sudo}) return request.render('survey.survey_print', { + 'review': review, 'survey': survey_sudo, 'answer': answer_sudo, 'page_nr': 0, diff --git a/addons/survey/views/survey_templates.xml b/addons/survey/views/survey_templates.xml index 42026433076..48bcd2ff52a 100644 --- a/addons/survey/views/survey_templates.xml +++ b/addons/survey/views/survey_templates.xml @@ -45,7 +45,7 @@
- If you wish, you can review your answers + If you wish, you can review your answers
@@ -482,7 +482,7 @@

- +