From 51d131663cba951a216dc14d46c84e3e0db6d80e Mon Sep 17 00:00:00 2001 From: David Beguin Date: Wed, 1 Dec 2021 08:46:42 +0000 Subject: [PATCH] [FIX] survey: test if survey exist in survey_layout for background management Since fd75481d52878962a782cfe740be25b731c99efd, we use the survey variable to compute the background_image_url in the survey_layout. In some cases (notably in survey_session_code template), this layout is used without knowing the variable 'survey'. After this commit, the 'survey' variable is tested before usage. Also, this commit add the o_survey_background class to the t-attf-class that already exists on 'wrapwrap' selector. Otherwise, by having both t-att-class and t-attf-class, only the t-att-class is kept. Task-2703147 closes odoo/odoo#80656 Signed-off-by: Thibault Delavallee (tde) --- addons/survey/views/survey_templates.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/survey/views/survey_templates.xml b/addons/survey/views/survey_templates.xml index 367692e984f..ccec0920e35 100644 --- a/addons/survey/views/survey_templates.xml +++ b/addons/survey/views/survey_templates.xml @@ -14,9 +14,9 @@ else ('background-image: url(' + page.background_image_url + ');') if page and page.background_image_url else ('background-image: url(' + survey.background_image_url + ');') - if survey.background_image_url + if survey and survey.background_image_url else '')"/> - +