diff --git a/addons/point_of_sale/static/src/app/screens/product_screen/product_screen.js b/addons/point_of_sale/static/src/app/screens/product_screen/product_screen.js index 28db69d715c..2065c8f2f4a 100644 --- a/addons/point_of_sale/static/src/app/screens/product_screen/product_screen.js +++ b/addons/point_of_sale/static/src/app/screens/product_screen/product_screen.js @@ -146,8 +146,6 @@ export class ProductScreen extends ControlButtonsMixin(Component) { await this.pos._addProducts(foundProductIds); // assume that the result is unique. product = this.pos.db.get_product_by_id(foundProductIds[0]); - } else { - return this.popup.add(ErrorBarcodePopup, { code: code.base_code }); } } return product; @@ -155,7 +153,7 @@ export class ProductScreen extends ControlButtonsMixin(Component) { async _barcodeProductAction(code) { const product = await this._getProductByBarcode(code); if (!product) { - return; + return this.popup.add(ErrorBarcodePopup, { code: code.base_code }); } const options = await product.getAddProductOptions(code); // Do not proceed on adding the product when no options is returned. @@ -212,7 +210,7 @@ export class ProductScreen extends ControlButtonsMixin(Component) { const lotBarcode = parsed_results.find((element) => element.type === "lot"); const product = await this._getProductByBarcode(productBarcode); if (!product) { - return; + return this.popup.add(ErrorBarcodePopup, { code: productBarcode.base_code }); } const options = await product.getAddProductOptions(lotBarcode); await this.currentOrder.add_product(product, options);