| 1 |
import { markup } from "@odoo/owl"; |
| 2 |
import { _t } from "@web/core/l10n/translation"; |
| 3 |
import { registry } from "@web/core/registry"; |
| 4 |
import { stepUtils } from "@web_tour/tour_utils"; |
| 5 |
|
| 6 |
registry.category("web_tour.tours").add("sale_tour", { |
| 7 |
url: "/odoo", |
| 8 |
steps: () => [ |
| 9 |
stepUtils.showAppsMenuItem(), |
| 10 |
{ |
| 11 |
isActive: ["community"], |
| 12 |
trigger: ".o_app[data-menu-xmlid='sale.sale_menu_root']", |
| 13 |
content: _t("Let’s create a beautiful quotation in a few clicks ."), |
| 14 |
tooltipPosition: "right", |
| 15 |
run: "click", |
| 16 |
}, |
| 17 |
{ |
| 18 |
isActive: ["enterprise"], |
| 19 |
trigger: ".o_app[data-menu-xmlid='sale.sale_menu_root']", |
| 20 |
content: _t("Let’s create a beautiful quotation in a few clicks ."), |
| 21 |
tooltipPosition: "bottom", |
| 22 |
run: "click", |
| 23 |
}, |
| 24 |
{ |
| 25 |
trigger: ".o_sale_order", |
| 26 |
}, |
| 27 |
{ |
| 28 |
trigger: "button.o_list_button_add", |
| 29 |
content: _t("Build your first quotation right here!"), |
| 30 |
tooltipPosition: "bottom", |
| 31 |
run: "click", |
| 32 |
}, |
| 33 |
{ |
| 34 |
trigger: ".o_sale_order", |
| 35 |
}, |
| 36 |
{ |
| 37 |
trigger: ".o_field_res_partner_many2one[name='partner_id'] input", |
| 38 |
content: _t("Search a customer name, or create one on the fly."), |
| 39 |
tooltipPosition: "right", |
| 40 |
run: "edit Agrolait", |
| 41 |
}, |
| 42 |
{ |
| 43 |
isActive: ["auto"], |
| 44 |
trigger: ".ui-menu-item > a:contains('Agrolait')", |
| 45 |
run: "click", |
| 46 |
}, |
| 47 |
{ |
| 48 |
trigger: ".o_field_x2many_list_row_add > a", |
| 49 |
content: _t("Click here to add some products or services to your quotation."), |
| 50 |
tooltipPosition: "bottom", |
| 51 |
run: "click", |
| 52 |
}, |
| 53 |
{ |
| 54 |
trigger: ".o_sale_order", |
| 55 |
}, |
| 56 |
{ |
| 57 |
trigger: ` |
| 58 |
.o_field_widget[name='product_id'] input, |
| 59 |
.o_field_widget[name='product_template_id'] input |
| 60 |
`, |
| 61 |
content: _t("Select a product, or create a new one on the fly."), |
| 62 |
tooltipPosition: "right", |
| 63 |
run: "edit DESK0001", |
| 64 |
}, |
| 65 |
{ |
| 66 |
isActive: ["auto"], |
| 67 |
trigger: "a:contains('DESK0001')", |
| 68 |
run: "click", |
| 69 |
}, |
| 70 |
{ |
| 71 |
trigger: ".oi-arrow-right", // Wait for product creation |
| 72 |
}, |
| 73 |
{ |
| 74 |
trigger: ".o_field_widget[name='price_unit'] input", |
| 75 |
content: _t("add the price of your product."), |
| 76 |
tooltipPosition: "right", |
| 77 |
run: "edit 10.0 && click body", |
| 78 |
}, |
| 79 |
{ |
| 80 |
isActive: ["auto"], |
| 81 |
trigger: ".o_field_cell[name='price_subtotal']:contains(10.00)", |
| 82 |
run: "click", |
| 83 |
}, |
| 84 |
{ |
| 85 |
isActive: ["auto", "mobile"], |
| 86 |
trigger: ".o_statusbar_buttons button[name='action_quotation_send']", |
| 87 |
}, |
| 88 |
...stepUtils.statusbarButtonsSteps( |
| 89 |
"Send", |
| 90 |
markup(_t("<b>Send the quote</b> to yourself and check what the customer will receive.")), |
| 91 |
), |
| 92 |
{ |
| 93 |
isActive: ["body:not(:has(.modal-footer button.o_mail_send))"], |
| 94 |
trigger: ".modal-footer button[name='document_layout_save']", |
| 95 |
content: _t("let's continue"), |
| 96 |
tooltipPosition: "bottom", |
| 97 |
run: "click", |
| 98 |
}, |
| 99 |
{ |
| 100 |
trigger: ".modal-footer button.o_mail_send", |
| 101 |
content: _t("Go ahead and send the quotation."), |
| 102 |
tooltipPosition: "bottom", |
| 103 |
run: "click", |
| 104 |
}, |
| 105 |
{ |
| 106 |
isActive: ["auto"], |
| 107 |
trigger: "body:not(.modal-open)", |
| 108 |
run: "click", |
| 109 |
}, |
| 110 |
], |
| 111 |
}); |