[FIX] pos_self_order: get orders by access token

Prior to this commit the get_orders_by_access_token return always an
empty result. A tour has been added to make sure it won't reproduce again.

Steps To Reproduce:
- Open self order
- Click view menu
- Select a product and "Add to cart"
- Click review and order the product
- Click on My Orders
- There would be no product ordered

closes odoo/odoo#135372

X-original-commit: d1663f991af9ad4ce271c8e86ca51bd934363d96
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Loukas Wets (lowe) <lowe@odoo.com>
This commit is contained in:
Loukas Wets (lowe)
2023-09-14 11:22:51 +00:00
parent 639a2b2296
commit 3a6a7d46de
2 changed files with 35 additions and 0 deletions
@@ -0,0 +1,26 @@
/** @odoo-module **/
import { registry } from "@web/core/registry";
import { PosSelf } from "./tour_utils";
registry.category("web_tour.tours").add("test_self_order_my_orders_tour", {
test: true,
steps: () => [
// Verify if the self is open and My Orders is not displayed because we are in "meal" mode
PosSelf.check.isNotNotification(),
PosSelf.check.isNotPrimaryBtn("My Orders"),
PosSelf.action.clickPrimaryBtn("View Menu"),
...PosSelf.action.addProduct("Office Chair Black", 1),
PosSelf.action.clickPrimaryBtn("Review"),
PosSelf.check.isOrderline("Office Chair Black", "138.58", ""),
PosSelf.action.clickPrimaryBtn("Order"),
PosSelf.check.tablePopupIsShown(),
PosSelf.action.selectTable({ id: "1", name: "1" }),
PosSelf.action.clickPrimaryBtn("Confirm"),
PosSelf.check.isNotification("Your order has been placed!"),
PosSelf.action.clickPrimaryBtn("My Orders"),
PosSelf.check.isOrderline("Office Chair Black", "138.58", ""),
],
});
@@ -39,3 +39,12 @@ class TestFrontendMobile(SelfOrderCommonTest):
"self_order_menu_only_tour",
login=None,
)
def test_self_order_my_orders_tour(self):
self.pos_config.self_order_table_mode = True
self.pos_config.self_order_pay_after = "meal"
self.pos_config.with_user(self.pos_user).open_ui()
self.start_tour(
self.pos_config._get_self_order_route(),
"test_self_order_my_orders_tour",
login=None,
)