[FIX] pos_restaurant: order management screen random runbot error
Initial rendering of order management screen shows the list of orders based on the previous render. This is done so that during fetching of new orders from the server, a list of orders are already shown. This optimization causes a random runbot error when transferring an order from one table to the other. The moment the order management screen is open, it will render orders with the old table, but right after fetching of orders, the listed orders are immediately updated. To rectify the random error, we modify the test so that instead of immediately clicking the transferred order, we wait for its new table to show before selecting it. closes odoo/odoo#57104 X-original-commit: 713dd3777ca0ce9d121d5162a3d63de3237509f4 Signed-off-by: pimodoo <pimodoo@users.noreply.github.com> Signed-off-by: Joseph Caburnay (jcb) <caburj@users.noreply.github.com>
This commit is contained in:
@@ -12,11 +12,15 @@ odoo.define('point_of_sale.tour.OrderManagementScreenTourMethods', function (req
|
||||
},
|
||||
];
|
||||
}
|
||||
clickOrder(name) {
|
||||
clickOrder(name, [otherCol, otherColVal] = [null, null]) {
|
||||
let trigger = `.order-management-screen .order-list .order-row .item.name:contains("${name}")`;
|
||||
if (otherCol) {
|
||||
trigger = `${trigger} ~ .item.${otherCol}:contains("${otherColVal}")`;
|
||||
}
|
||||
return [
|
||||
{
|
||||
content: `clicking order '${name}' from orderlist`,
|
||||
trigger: `.order-management-screen .order-list .order-row .item:contains("${name}")`,
|
||||
trigger,
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ odoo.define('pos_restaurant.tour.OrderManagementScreen', function (require) {
|
||||
OrderManagementScreen.check.isShown();
|
||||
|
||||
// select order 0004 and check if it is now in T2
|
||||
OrderManagementScreen.do.clickOrder('-0004');
|
||||
OrderManagementScreen.do.clickOrder('-0004', ['table', 'T2']);
|
||||
ProductScreen.check.isShown();
|
||||
ProductScreen.check.totalAmountIs('278');
|
||||
Chrome.check.backToFloorTextIs('Main Floor', 'T2');
|
||||
|
||||
Reference in New Issue
Block a user