Skip to content

Commit 05ded25

Browse files
jaeschwavava-odoo
authored andcommitted
[IMP] *: add knowledge tour to redirect to knowledge article
Added the knowledge tour to all industry modules so when a DB is started a tour pointing to the knowledge app is directly launched. To avoid the maintenance lines of code for these tours, these files are added in the cloc_exclude of the manifest, leading to the automatic creation of ir_model_data entries to exclude the cloc. This change is related to this PR: odoo/odoo@a47de680de14 In all the modules, the message related to the onboarding is improved. task-4056239
1 parent 18a08d4 commit 05ded25

File tree

244 files changed

+2394
-942
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

244 files changed

+2394
-942
lines changed

agriculture_shop/__manifest__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
'data/website_view.xml',
3838
'data/website_theme_apply.xml',
3939
'data/ir_model_data.xml',
40+
'data/knowledge_tour.xml',
4041
],
4142
'demo': [
4243
'demo/res_partner.xml',
@@ -66,6 +67,15 @@
6667
'demo/payment_provider_demo_post.xml',
6768
],
6869
'license': 'OPL-1',
70+
'assets': {
71+
'web.assets_backend': [
72+
'agriculture_shop/static/src/js/my_tour.js',
73+
]
74+
},
6975
'author': 'Odoo S.A.',
76+
"cloc_exclude": [
77+
"data/knowledge_article.xml",
78+
"static/src/js/my_tour.js",
79+
],
7080
'images': ['images/main.png'],
7181
}

agriculture_shop/data/knowledge_article.xml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
11
<?xml version='1.0' encoding='UTF-8'?>
22
<odoo>
3-
<record id="knowledge_article_1" model="knowledge.article">
4-
<field name="name">Agriculture Store</field>
5-
<field name="internal_permission">write</field>
6-
<field name="icon">🍀</field>
7-
<field name="cover_image_id" ref="knowledge_cover_6"/>
8-
<field name="is_article_visible_by_everyone" eval="True"/>
9-
<field name="is_locked" eval="True"/>
10-
<field name="body">
11-
<![CDATA[
3+
<template id="welcome_article_body">
4+
<![CDATA[
125
<p>
136
<span style="font-size: 36px;"><strong>Agricultural Retail</strong></span>
147
</p>
@@ -87,7 +80,18 @@
8780
<li>Sales person shares quotation and confirm the order.</li>
8881
<li>Make Invoice.</li>
8982
</ul>
90-
]]>
83+
]]>
84+
</template>
85+
86+
<record id="welcome_article" model="knowledge.article">
87+
<field name="name">Agriculture Store</field>
88+
<field name="internal_permission">write</field>
89+
<field name="icon">🍀</field>
90+
<field name="cover_image_id" ref="knowledge_cover_6"/>
91+
<field name="is_article_visible_by_everyone" eval="True"/>
92+
<field name="is_locked" eval="True"/>
93+
<field name="body">
94+
<![CDATA[]]>
9195
</field>
9296
</record>
9397
</odoo>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version='1.0' encoding='UTF-8'?>
22
<odoo noupdate="1">
33
<record id="knowledge_favorite" model="knowledge.article.favorite">
4-
<field name="article_id" ref="knowledge_article_1"/>
4+
<field name="article_id" ref="welcome_article"/>
55
<field name="user_id" ref="base.user_admin"/>
66
</record>
77
</odoo>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<odoo>
3+
<record id="knowledge_tour" model="web_tour.tour">
4+
<field name="name">knowledge_tour</field>
5+
<field name="sequence">2</field>
6+
<field name="rainbow_man_message">Welcome! Happy exploring.</field>
7+
</record>
8+
</odoo>

agriculture_shop/data/mail_message.xml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@
66
<field name="message_type">email</field>
77
<field name="author_id" ref="base.partner_root"/>
88
<field name="subtype_id" ref="mail.mt_comment"/>
9-
<field name="subject">Knowledge article</field>
9+
<field name="subject">🚀 Get started with Odoo Agriculture Shop</field>
1010
<field name="body" model="knowledge.article" eval="
11-
'&lt;br>Hey! Need help?&lt;/br>
12-
&lt;br>Checkout this &lt;a href=\''
13-
+ obj().env.ref('agriculture_shop.knowledge_article_1').article_url.replace(obj().get_base_url(), '')
14-
+ '\'>article&lt;/a>&lt;/br>'"/>
11+
'&lt;span>&#x1F44B; Hi! Follow this &lt;a href=\''
12+
+ obj().env.ref('agriculture_shop.welcome_article').article_url
13+
+ '\'>onboarding guide&lt;/a>. You can find it anytime in the Knowledge app.&lt;/span>'"/>
1514
</record>
1615
</odoo>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/** @odoo-module **/
2+
3+
import { _t } from "@web/core/l10n/translation";
4+
import { registry } from "@web/core/registry";
5+
6+
registry.category("web_tour.tours").add("knowledge_tour", {
7+
url: "/odoo",
8+
9+
steps: () => [
10+
{
11+
trigger: '.o_app[data-menu-xmlid="knowledge.knowledge_menu_root"]',
12+
content: _t("Get on track and explore our recommendations for your Odoo usage here!"),
13+
position: "bottom",
14+
run: "click",
15+
},
16+
],
17+
});

architects/__manifest__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
'data/website_view.xml',
4646
'data/website_theme_apply.xml',
4747
'data/ir_model_data.xml',
48+
'data/knowledge_tour.xml',
4849
],
4950
'demo': [
5051
'demo/website.xml',
@@ -59,6 +60,15 @@
5960
'demo/hr_expense_action.xml',
6061
],
6162
'license': 'OPL-1',
63+
'assets': {
64+
'web.assets_backend': [
65+
'architects/static/src/js/my_tour.js',
66+
]
67+
},
6268
'author': 'Odoo S.A.',
69+
"cloc_exclude": [
70+
"data/knowledge_article.xml",
71+
"static/src/js/my_tour.js",
72+
],
6373
'images': ['images/main.png'],
6474
}

architects/data/knowledge_article.xml

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
11
<?xml version='1.0' encoding='UTF-8'?>
22
<odoo>
3-
<record id="knowledge_article_3" model="knowledge.article">
4-
<field name="name">Architecture Firm</field>
5-
<field name="sequence">2</field>
6-
<field name="category">workspace</field>
7-
<field name="internal_permission">write</field>
8-
<field name="is_article_visible_by_everyone" eval="True"/>
9-
<field name="cover_image_id" ref="knowledge_cover_2"/>
10-
<field name="cover_image_position">68.59</field>
11-
<field name="icon">📏</field>
12-
<field name="body">
13-
<![CDATA[
3+
<template id="welcome_article_body">
4+
<![CDATA[
145
<h1>Architect Industry</h1>
156
<p>
167
<span style="font-size: 16px;">
@@ -70,7 +61,19 @@
7061
</span>
7162
<br />
7263
</p>
73-
]]>
64+
]]>
65+
</template>
66+
<record id="welcome_article" model="knowledge.article">
67+
<field name="name">Architecture Firm</field>
68+
<field name="sequence">2</field>
69+
<field name="category">workspace</field>
70+
<field name="internal_permission">write</field>
71+
<field name="is_article_visible_by_everyone" eval="True"/>
72+
<field name="cover_image_id" ref="knowledge_cover_2"/>
73+
<field name="cover_image_position">68.59</field>
74+
<field name="icon">📏</field>
75+
<field name="body">
76+
<![CDATA[]]>
7477
</field>
7578
</record>
7679
</odoo>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version='1.0' encoding='UTF-8'?>
22
<odoo noupdate="1">
33
<record id="knowledge_favorite" model="knowledge.article.favorite">
4-
<field name="article_id" ref="knowledge_article_3"/>
4+
<field name="article_id" ref="welcome_article"/>
55
<field name="user_id" ref="base.user_admin"/>
66
</record>
77
</odoo>

architects/data/knowledge_tour.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<odoo>
3+
<record id="knowledge_tour" model="web_tour.tour">
4+
<field name="name">knowledge_tour</field>
5+
<field name="sequence">2</field>
6+
<field name="rainbow_man_message">Welcome! Happy exploring.</field>
7+
</record>
8+
</odoo>

0 commit comments

Comments
 (0)