From f75a459529a2656d453034afe2ea1f58b7cb4f1f Mon Sep 17 00:00:00 2001 From: PabloCalles Date: Mon, 27 Oct 2025 10:36:04 -0300 Subject: [PATCH] Update ProductScreen.js --- .../static/src/js/ProductScreen.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pos_restrict_product_stock/static/src/js/ProductScreen.js b/pos_restrict_product_stock/static/src/js/ProductScreen.js index c3c8976c06..0369925687 100644 --- a/pos_restrict_product_stock/static/src/js/ProductScreen.js +++ b/pos_restrict_product_stock/static/src/js/ProductScreen.js @@ -12,7 +12,13 @@ setup() { this.dialog = useService("dialog"); }, async addProductToOrder(...args) { - var type = this.pos.config.stock_type + const product = args[0]; + const stock_type = this.pos.config.stock_type; + const product_type = product.type || null; + if (product_type === 'service' || product_type === 'consu') { + console.log('Cybro Ignorando stock para tipo:', product_type); + super.addProductToOrder(...args); + } if (this.pos.config.is_restrict_product && ((type == 'qty_on_hand') && (args['0'].qty_available <= 0)) | ((type == 'virtual_qty') && (args['0'].virtual_available <= 0)) | ((args['0'].qty_available <= 0) && (args['0'].virtual_available <= 0))) { // If the product restriction is activated in the settings and quantity is out stock, it show the restrict popup. @@ -20,7 +26,6 @@ setup() { body: _t("%s is out of stock. Do you want to proceed?", args['0'].display_name), confirmLabel: _t("Order"), confirm: () => { - const product = args['0']; product.order_status = true; super.addProductToOrder(...args) },