[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) <jcb@odoo.com> Signed-off-by: Robin Engels (roen) <roen@odoo.com>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user