From 020f5061d14a87c654c6ceaa069b5c37fa02e297 Mon Sep 17 00:00:00 2001 From: "Pedram (PEBR)" Date: Thu, 21 Sep 2023 14:23:19 +0000 Subject: [PATCH] [FIX] point_of_sale: Prevent adding archived products by barcode When limited product loading is enabled, archived products can still be added to orders by scanning their barcode, because `get_pos_ui_product_product_by_params` loads archived products to prevent errors when refunding orders. This allows adding archived products via barcode even though they are not visible in the POS interface. To prevent this, we exclude archived products from the product_by_barcode when adding products to it. This ensures archived products cannot be added by barcode when limited product loading is enabled. opw-3502136 closes odoo/odoo#137119 X-original-commit: 95c3807d541afe0581b636eb8394cd8f79bb770e Signed-off-by: Joseph Caburnay (jcb) Signed-off-by: Pedram Bi Ria (pebr) --- addons/point_of_sale/static/src/app/store/db.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/point_of_sale/static/src/app/store/db.js b/addons/point_of_sale/static/src/app/store/db.js index feb041ca454..f45345a2d5c 100644 --- a/addons/point_of_sale/static/src/app/store/db.js +++ b/addons/point_of_sale/static/src/app/store/db.js @@ -268,7 +268,7 @@ export class PosDB { } } this.product_by_id[product.id] = product; - if (product.barcode) { + if (product.barcode && product.active) { this.product_by_barcode[product.barcode] = product; } }