From 35e916272a2f850735208e7cfa9d6af2293ff01c Mon Sep 17 00:00:00 2001 From: Denis Roussel Date: Thu, 13 Jan 2022 14:25:08 +0100 Subject: [PATCH] [14.0][FIX] pos_reset_search: Iterate on owl children --- .../static/src/js/ProductScreen.js | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/pos_reset_search/static/src/js/ProductScreen.js b/pos_reset_search/static/src/js/ProductScreen.js index 119c56ce17..9b6d387491 100644 --- a/pos_reset_search/static/src/js/ProductScreen.js +++ b/pos_reset_search/static/src/js/ProductScreen.js @@ -8,16 +8,24 @@ odoo.define("pos_reset_search.ProductScreen", function (require) { class extends ProductScreen { async _clickProduct(event) { const ProductScreenChildren = this.__owl__.children; - - const ProductWidget = ProductScreenChildren.find( - (child) => child.el.className === "products-widget" - ); + var ProductWidget = null; + for (const key in ProductScreenChildren) { + if (ProductScreenChildren[key].el.className === "products-widget") { + ProductWidget = ProductScreenChildren[key]; + } + } if (ProductWidget) { const ProductWidgetChildren = ProductWidget.__owl__.children; - const ProductsWidgetControlPanel = ProductWidgetChildren.find( - (child) => child.el.className === "products-widget-control" - ); + var ProductsWidgetControlPanel = null; + for (const key in ProductWidgetChildren) { + if ( + ProductWidgetChildren[key].el.className === + "products-widget-control" + ) { + ProductWidget = ProductWidgetChildren[key]; + } + } if (ProductsWidgetControlPanel) { ProductsWidgetControlPanel.clearSearch(); }