From 8360daa05765666b3486e8d8549cb1a749089692 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Fri, 3 Nov 2017 12:45:38 +0100 Subject: [PATCH] [FIX] sale_stock: failing sale_stock.tour according to the modules installed The `sale_stock.tour` failed in the case the admin was not part of the group `product.group_stock_packaging` or the group `sale.group_mrp_properties` because then the sale order was working with the editable list, which does not open a dialog, while the test was relying on the dialog to be opened, in order to close it. The fix is simply to pass the fact to close the dialog if there is none. opw-779308 --- addons/sale_stock/static/src/js/tour.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/sale_stock/static/src/js/tour.js b/addons/sale_stock/static/src/js/tour.js index cb10a00c5ef..690150677de 100644 --- a/addons/sale_stock/static/src/js/tour.js +++ b/addons/sale_stock/static/src/js/tour.js @@ -20,7 +20,9 @@ odoo.define("sale_stock.tour", function (require) { auto: true, in_modal: false, run: function (actions) { - actions.auto(".modal-footer .btn-primary"); + if ($('.modal-footer .btn-primary').length){ + actions.auto(".modal-footer .btn-primary"); + } }, }); });