From 03bb883d2c46b5d5763bcc2af11d8387f679fefe Mon Sep 17 00:00:00 2001 From: roen-odoo Date: Tue, 13 Jun 2023 09:16:58 +0000 Subject: [PATCH] [FIX] point_of_sale: prevent adding not saleable product with scan Current behavior: When scanning the barcode of a product that is not saleable, the product was added to the order. Steps to reproduce: - Create a product that is not saleable and not available in PoS - Set a barcode for this product - Open the PoS, and scan the barcode of the product - The product is added to the order even if it is not saleable opw-3325238 closes odoo/odoo#126293 X-original-commit: 3a3997e22b6a21c66455718a117c7c424526745e Signed-off-by: Joseph Caburnay (jcb) Signed-off-by: Robin Engels (roen) --- .../static/src/app/screens/product_screen/product_screen.js | 1 + 1 file changed, 1 insertion(+) 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 4cd500acbaf..bbc105d5217 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 @@ -140,6 +140,7 @@ export class ProductScreen extends ControlButtonsMixin(Component) { let foundProductIds = []; foundProductIds = await this.orm.search("product.product", [ ["barcode", "=", code.base_code], + ["sale_ok", "=", true], ]); if (foundProductIds.length) { await this.pos._addProducts(foundProductIds);