[IMP] web_tour: Disable tours when Odoo installed with demo data
This commit is contained in:
committed by
Yannick Tivisse
parent
392c91cda3
commit
b7eee16a58
@@ -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",
|
||||
],
|
||||
|
||||
@@ -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);
|
||||
},
|
||||
});
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user