[FIX] survey: unregistered tour

This commit aims to make unit tests pass when creating a new database
with only 'survey' installed.

The tour 'test_survey' was not loaded before reaching /survey/start,
causing tests to fail.

The js asset is now loaded within web.assets_common because the tour
should also work with the 'public' user. For this reason,
'web.assets_backend' is not a good fit.

Widget 'root.widget' was undefined too. Appropriate js file is now
loaded.

Closes #33330

Signed-off-by: Christophe Simonis <chs@odoo.com>
This commit is contained in:
Johan Demaret Rivarola
2019-05-13 12:25:22 +00:00
parent 611eea839c
commit d273bdfed7
+7 -1
View File
@@ -8,7 +8,7 @@
<script type="text/javascript" src="/web/static/src/js/services/session.js"></script>
<script type="text/javascript" src="/survey/static/src/js/survey_result.js" />
<script type="text/javascript" src="/survey/static/src/js/survey.js" />
<script type="text/javascript" src="/survey/static/src/js/tour_test_survey.js"></script>
<script type="text/javascript" src="/web/static/src/js/chrome/public_root_widget.js"></script>
<script type="text/javascript" src="/web/static/src/js/fields/field_utils.js"></script>
<t t-call="web._assets_frontend_helpers"/>
@@ -21,6 +21,12 @@
<link href="/survey/static/src/css/survey_result.css" rel="stylesheet" type="text/css"></link>
</template>
<template id="assets_common" name="tour" inherit_id="web.assets_common">
<xpath expr="//script[last()]" position="after">
<script type="text/javascript" src="/survey/static/src/js/tour_test_survey.js"></script>
</xpath>
</template>
<!-- Forbidden error messages-->
<template id="403">
<t t-call="survey.layout">