summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorJoseph Caburnay <jcb@odoo.com>2020-09-21 12:27:39 +0000
committerJoseph Caburnay <jcb@odoo.com>2020-09-21 14:15:56 +0000
commitaaec45b9aece17f8c764cd7a89eb243a5fc11924 (patch)
tree7b3a18aec38b5f695b75cfbf2acca1d3322532de /addons
parentff4cbf87139179fe6b7abc8a4e52b939e5553852 (diff)
[FIX] pos_restaurant: runbot random error on clicking table
Checking the log of the runbot error, there is an extra `create_from_ui` rpc call for `restaurant.floor`. This is because when table T4 is clicked, it is still an `EditableTable`. It is possible that the full rendering after toggling edit mode isn't complete and the tour proceeds because it sees table T4 in the dom, when in fact the table we want to click should not be `EditableTable` instead a `TableWidget`. This is random because the tour may proceed as long at it sees the trigger element, even if the owl rendering is not finished. In this commit, we make sure that we click the correct element which is an unselected table. So we check if table T4 is unselected before clicking table T4 to open the product screen. To reproduce, follow instructions here: https://gist.github.com/caburj/ef311076a24d898132ed9c6b99367581 closes odoo/odoo#58146 X-original-commit: 238a65f59202d279d2c9327dd7937f125d80175b Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Diffstat (limited to 'addons')
-rw-r--r--addons/pos_restaurant/static/tests/tours/FloorScreen.tour.js2
-rw-r--r--addons/pos_restaurant/static/tests/tours/helpers/FloorScreenTourMethods.js9
2 files changed, 10 insertions, 1 deletions
diff --git a/addons/pos_restaurant/static/tests/tours/FloorScreen.tour.js b/addons/pos_restaurant/static/tests/tours/FloorScreen.tour.js
index f4e12080305..af52936264c 100644
--- a/addons/pos_restaurant/static/tests/tours/FloorScreen.tour.js
+++ b/addons/pos_restaurant/static/tests/tours/FloorScreen.tour.js
@@ -93,7 +93,7 @@ odoo.define('pos_restaurant.tour.FloorScreen', function (require) {
// Opening product screen in main floor should go back to main floor
FloorScreen.do.clickEdit();
FloorScreen.check.editModeIsActive(false);
- FloorScreen.check.hasTable('T4');
+ FloorScreen.check.tableIsNotSelected('T4');
FloorScreen.do.clickTable('T4');
ProductScreen.check.isShown();
Chrome.check.backToFloorTextIs('Main Floor', 'T4');
diff --git a/addons/pos_restaurant/static/tests/tours/helpers/FloorScreenTourMethods.js b/addons/pos_restaurant/static/tests/tours/helpers/FloorScreenTourMethods.js
index b6e614357f0..733fd26d90a 100644
--- a/addons/pos_restaurant/static/tests/tours/helpers/FloorScreenTourMethods.js
+++ b/addons/pos_restaurant/static/tests/tours/helpers/FloorScreenTourMethods.js
@@ -140,6 +140,15 @@ odoo.define('pos_restaurant.tour.FloorScreenTourMethods', function (require) {
},
];
}
+ tableIsNotSelected(name) {
+ return [
+ {
+ content: `table '${name}' is not selected`,
+ trigger: `.floor-map .table:not(.selected) .label:contains("${name}")`,
+ run: function () {},
+ },
+ ];
+ }
}
class Execute {}