[IMP] web_tour: Disable tours when Odoo installed with demo data

This commit is contained in:
Jigar Patel
2017-12-21 12:58:41 +01:00
committed by Yannick Tivisse
parent 392c91cda3
commit b7eee16a58
3 changed files with 35 additions and 0 deletions
+3
View File
@@ -16,6 +16,9 @@ Odoo Web tours.
'views/tour_templates.xml',
'views/tour_views.xml'
],
'demo': [
'data/web_tour_demo.xml',
],
'qweb': [
"static/src/xml/*.xml",
],
+11
View File
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Disable tours if Odoo installed with demo data. -->
<template id="assets_common_disable_tour" name="disable tour" inherit_id="web.assets_common">
<xpath expr="." position="inside">
<script type="text/javascript" src="/web_tour/static/src/js/tour_disable.js"></script>
</xpath>
</template>
</odoo>
@@ -0,0 +1,21 @@
odoo.define('web_tour.DisableTour', function (require) {
"use strict";
var TourManager = require('web_tour.TourManager');
TourManager.include({
/**
* Disables tours if Odoo installed with demo data.
*
* @override
*/
_register: function (do_update, tour, name) {
// Consuming tours which are not run by test case
if (!this.running_tour) {
this.consumed_tours.push(name);
}
return this._super.apply(this, arguments);
},
});
});