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(); }