Skip to content

Commit

Permalink
Enable test tours only in demo instances.
Browse files Browse the repository at this point in the history
Usually tests depend on demo data, and they are enabled only in development
environments. By enabling the asset in demo data, you remove them from
production instances and thus increase their performance and security, losing
no features.
  • Loading branch information
yajo committed Nov 3, 2016
1 parent a4f5c02 commit 4646d20
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions template/module/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"wizards/wizard_model_view.xml",
],
"demo": [
"demo/assets.xml",
"demo/res_partner_demo.xml",
],
"qweb": [
Expand Down
16 changes: 16 additions & 0 deletions template/module/demo/assets.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright <YEAR(S)> <AUTHOR(S)>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->

<openerp>
<data>

<template id="assets_frontend_demo" inherit_id="website.assets_frontend">
<xpath expr=".">
<script type="text/javascript"
src="/module/static/src/js/module_name.tour.js"/>
</xpath>
</template>

</data>
</openerp>
1 change: 1 addition & 0 deletions template/module/templates/assets.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

<template id="assets_editor" inherit_id="website.assets_editor">
<xpath expr=".">
<!-- If tour is only for testing, better add it in demo/assets.xml -->
<script type="text/javascript"
src="/module/static/src/js/module_name.tour.js"/>
</xpath>
Expand Down

0 comments on commit 4646d20

Please sign in to comment.