From 5939e22141deecb332bf18b6e1ef5a8d16098a0a Mon Sep 17 00:00:00 2001 From: Joseph Caburnay Date: Mon, 14 Sep 2020 15:10:52 +0000 Subject: [PATCH] [FIX] point_of_sale: searched orders should start at page 1 Create few validated orders. Then create other orders such that the validated orders will be found at page 3. Search for an order from the validated orders. BUG: You will see these searched orders in page 3. This commit fixes this issue by putting the search results in page 1. X-original-commit: 0a400313136ff7a7359d6105200522e859ce865d --- .../src/js/Screens/OrderManagementScreen/OrderFetcher.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/point_of_sale/static/src/js/Screens/OrderManagementScreen/OrderFetcher.js b/addons/point_of_sale/static/src/js/Screens/OrderManagementScreen/OrderFetcher.js index 3490a46378a..9af727717d9 100644 --- a/addons/point_of_sale/static/src/js/Screens/OrderManagementScreen/OrderFetcher.js +++ b/addons/point_of_sale/static/src/js/Screens/OrderManagementScreen/OrderFetcher.js @@ -14,6 +14,9 @@ odoo.define('point_of_sale.OrderFetcher', function (require) { this.cache = {}; this.totalCount = 0; } + get activeOrders() { + return this.searchDomain ? [] : this.comp.env.pos.get('orders').models; + } get nActiveOrders() { return this.activeOrders.length; } @@ -164,7 +167,6 @@ odoo.define('point_of_sale.OrderFetcher', function (require) { } setComponent(comp) { this.comp = comp; - this.activeOrders = this.comp.env.pos.get('orders').models; return this; } setConfigId(configId) {