summaryrefslogtreecommitdiff
path: root/addons/purchase_stock
diff options
context:
space:
mode:
authorNasreddin (bon) <bon@odoo.com>2020-04-06 10:33:14 +0000
committerThibault Delavallée <tde@odoo.com>2020-04-14 11:33:40 +0000
commitafe40caf685268ec2b4521ec0ea25f69150cf08b (patch)
tree9856ff592e6896059d480d093e959505eb34e562 /addons/purchase_stock
parent376891294788706753b056f0151d198f0a493c64 (diff)
[IMP] purchase, purchase_stock: add an onboarding tour
Improve onboarding and guide first clicks of users in the purchase application to create a purchase order. In case Stock module is installed, it will also guide the users through the receipt first clicks process. Task ID 2219988 closes odoo/odoo#49031 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Diffstat (limited to 'addons/purchase_stock')
-rw-r--r--addons/purchase_stock/__manifest__.py1
-rw-r--r--addons/purchase_stock/static/src/js/tours/purchase_stock.js49
-rw-r--r--addons/purchase_stock/views/assets.xml8
3 files changed, 58 insertions, 0 deletions
diff --git a/addons/purchase_stock/__manifest__.py b/addons/purchase_stock/__manifest__.py
index 690baa483f0..471374708a5 100644
--- a/addons/purchase_stock/__manifest__.py
+++ b/addons/purchase_stock/__manifest__.py
@@ -13,6 +13,7 @@
'security/ir.model.access.csv',
'data/purchase_stock_data.xml',
'data/mail_data.xml',
+ 'views/assets.xml',
'views/purchase_views.xml',
'views/stock_views.xml',
'views/stock_rule_views.xml',
diff --git a/addons/purchase_stock/static/src/js/tours/purchase_stock.js b/addons/purchase_stock/static/src/js/tours/purchase_stock.js
new file mode 100644
index 00000000000..44e6eabe1b6
--- /dev/null
+++ b/addons/purchase_stock/static/src/js/tours/purchase_stock.js
@@ -0,0 +1,49 @@
+odoo.define('purchase_stock.purchase_steps', function (require) {
+"use strict";
+
+var core = require('web.core');
+
+var _t = core._t;
+var PurchaseAdditionalTourSteps = require('purchase.purchase_steps');
+
+PurchaseAdditionalTourSteps.include({
+
+ init: function() {
+ this._super.apply(this, arguments);
+ },
+
+ _get_purchase_stock_steps: function () {
+ this._super.apply(this, arguments);
+ return [{
+ trigger: ".oe_button_box button[name='action_view_picking']",
+ extra_trigger: ".oe_button_box button[name='action_view_picking']",
+ content: _t("Receive the ordered products."),
+ position: "bottom",
+ run: 'click',
+ }, {
+ trigger: ".o_statusbar_buttons button[name='button_validate']",
+ content: _t("Validate the receipt of all ordered products."),
+ position: "bottom",
+ run: 'click',
+ }, {
+ trigger: ".modal-footer .btn-primary",
+ extra_trigger: ".modal-dialog",
+ content: _t("Process all the receipt quantities."),
+ position: "bottom",
+ }, {
+ trigger: ".o_back_button a, .breadcrumb-item:not('.active'):last",
+ content: _t('Go back to the purchase order to generate the vendor bill.'),
+ position: 'bottom',
+ }, {
+ trigger: ".o_statusbar_buttons button[name='action_create_invoice']",
+ content: _t("Generate the draft vendor bill."),
+ position: "bottom",
+ run: 'click',
+ }
+ ];
+ }
+});
+
+return PurchaseAdditionalTourSteps;
+
+});
diff --git a/addons/purchase_stock/views/assets.xml b/addons/purchase_stock/views/assets.xml
new file mode 100644
index 00000000000..8724db5b521
--- /dev/null
+++ b/addons/purchase_stock/views/assets.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<odoo>
+ <template id="assets_backend" name="purchase stock assets" inherit_id="web.assets_backend">
+ <xpath expr="script[last()]" position="after">
+ <script type="text/javascript" src="/purchase_stock/static/src/js/tours/purchase_stock.js"></script>
+ </xpath>
+ </template>
+</odoo>