Skip to content

Commit 372f5d5

Browse files
committed
[FIX] purchase: fix tour by providing appropriate class
Before this commit: =================== - The purchase tour was failing because the tour's JavaScript used an incorrect class selector (targeting 'partner_id'), which prevented it from locating the intended DOM element. Consequently, the sequence of actions was interrupted, causing the tour to break midway. After this commit: =================== - The issue has been resolved by updating the tour to use the correct and unique class selector. This ensures the tour accurately targets the intended element, allowing it to proceed without interruptions. As a result, the purchase tour runs successfully and achieves its intended purpose. closes odoo#184735 Taskid: 4268662 Signed-off-by: Arnold Moyaux (arm) <[email protected]>
1 parent b69340b commit 372f5d5

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

addons/purchase/static/src/js/tours/purchase.js

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -48,20 +48,19 @@ tour.register('purchase_tour' , {
4848
content: _t("Let's create your first request for quotation."),
4949
position: "bottom",
5050
}, {
51-
trigger: ".o_form_editable .o_field_many2one[name='partner_id']",
51+
trigger: ".o_form_editable .o_field_res_partner_many2one[name='partner_id']",
5252
extra_trigger: ".o_purchase_order",
5353
content: _t("Search a vendor name, or create one on the fly."),
5454
position: "bottom",
5555
run: function (actions) {
56-
actions.text("Agrolait", this.$anchor.find("input"));
56+
actions.text("Azure Interior", this.$anchor.find("input"));
5757
},
5858
}, {
59-
trigger: ".ui-menu-item > a",
59+
trigger: ".ui-menu-item > a:contains('Azure Interior')",
6060
auto: true,
6161
in_modal: false,
6262
}, {
6363
trigger: ".o_field_x2many_list_row_add > a",
64-
extra_trigger: ".o_field_many2one[name='partner_id'] .o_external_button",
6564
content: _t("Add some products or services to your quotation."),
6665
position: "bottom",
6766
}, {
@@ -76,21 +75,16 @@ tour.register('purchase_tour' , {
7675
var keyDownEvent = jQuery.Event("keydown");
7776
keyDownEvent.which = 42;
7877
this.$anchor.trigger(keyDownEvent);
79-
var $descriptionElement = $('.o_form_editable textarea[name="name"]');
80-
// when description changes, we know the product has been created
81-
$descriptionElement.change(function () {
82-
$descriptionElement.addClass('product_creation_success');
83-
});
8478
},
8579
}, {
86-
trigger: '.ui-menu.ui-widget .ui-menu-item a:contains("DESK0001")',
80+
trigger: "a:contains('DESK0001')",
8781
auto: true,
8882
}, {
89-
trigger: '.o_form_editable textarea[name="name"].product_creation_success',
83+
trigger: "td[name='name'][data-tooltip*='DESK0001']",
9084
auto: true,
9185
run: function () {} // wait for product creation
9286
}, {
93-
trigger: ".o_form_editable input[name='product_qty'] ",
87+
trigger: "div.o_field_widget[name='product_qty'] input ",
9488
extra_trigger: ".o_purchase_order",
9589
content: _t("Indicate the product quantity you want to order."),
9690
position: "right",
@@ -115,7 +109,10 @@ tour.register('purchase_tour' , {
115109
position: "left",
116110
run: 'click',
117111
}, {
118-
trigger: ".o_field_widget [name=price_unit]",
112+
content: "Select price",
113+
trigger: 'tbody tr.o_data_row .o_list_number[name="price_unit"]',
114+
}, {
115+
trigger: 'tbody tr.o_data_row .o_list_number[name="price_unit"] input',
119116
extra_trigger: ".o_purchase_order",
120117
content: _t("Once you get the price from the vendor, you can complete the purchase order with the right price."),
121118
position: "right",

0 commit comments

Comments
 (0)