diff --git a/pos_restrict_product_stock/__manifest__.py b/pos_restrict_product_stock/__manifest__.py index cdadb4ef2..7d321a6a9 100644 --- a/pos_restrict_product_stock/__manifest__.py +++ b/pos_restrict_product_stock/__manifest__.py @@ -21,7 +21,7 @@ ############################################################################### { 'name': 'Display Stock in POS | Restrict Out-of-Stock Products in POS', - 'version': '15.0.1.0.0', + 'version': '15.0.1.0.2', 'category': 'Point of Sale', 'summary': "Enhance your Point of Sale experience by preventing the " "ordering of out-of-stock products during your session", @@ -35,7 +35,7 @@ 'website': 'https://www.cybrosys.com', 'depends': ['point_of_sale'], 'data': [ - 'views/pos_config_views.xml' + 'views/pos_config_views.xml', ], 'assets': { 'point_of_sale.assets': [ diff --git a/pos_restrict_product_stock/doc/RELEASE_NOTES.md b/pos_restrict_product_stock/doc/RELEASE_NOTES.md index dfef2abd9..c2a438608 100644 --- a/pos_restrict_product_stock/doc/RELEASE_NOTES.md +++ b/pos_restrict_product_stock/doc/RELEASE_NOTES.md @@ -9,3 +9,10 @@ #### Version 15.0.1.0.1 ### UPDT - Restricted payment if an item in the order is out of stock.Update product stock without refreshing the page. + +#### 06.11.2025 +#### Version 15.0.1.0.2 +### UPDT +- Service products and products measured with “To Weigh in Scale” enabled are now excluded from +Restrict Product Out of Stock in POS. + diff --git a/pos_restrict_product_stock/models/__init__.py b/pos_restrict_product_stock/models/__init__.py index bc63fc736..931d17f29 100644 --- a/pos_restrict_product_stock/models/__init__.py +++ b/pos_restrict_product_stock/models/__init__.py @@ -21,3 +21,4 @@ ############################################################################### from . import pos_config from . import product_product +from . import pos_session diff --git a/pos_restrict_product_stock/models/pos_session.py b/pos_restrict_product_stock/models/pos_session.py index c87445d95..cc51af818 100644 --- a/pos_restrict_product_stock/models/pos_session.py +++ b/pos_restrict_product_stock/models/pos_session.py @@ -34,4 +34,5 @@ class PosSession(models.Model): result = super()._loader_params_product_product() result['search_params']['fields'].append('qty_available') result['search_params']['fields'].append('virtual_available') + result['search_params']['fields'].append('detailed_type') return result diff --git a/pos_restrict_product_stock/models/product_product.py b/pos_restrict_product_stock/models/product_product.py index be7568c53..057892b07 100644 --- a/pos_restrict_product_stock/models/product_product.py +++ b/pos_restrict_product_stock/models/product_product.py @@ -32,5 +32,5 @@ class ProductProduct(models.Model): Retrieves a list of products that are available in the Point of Sale (POS) system, including their current available quantity and virtual available quantity. """ - products= self.search_read([('available_in_pos','=',True)],fields=['id', 'qty_available','virtual_available']) + products= self.search_read([('available_in_pos','=',True)],fields=['id', 'qty_available','virtual_available','detailed_type']) return products diff --git a/pos_restrict_product_stock/static/src/js/ProductScreen.js b/pos_restrict_product_stock/static/src/js/ProductScreen.js index 0793d99e8..c8dfb081e 100644 --- a/pos_restrict_product_stock/static/src/js/ProductScreen.js +++ b/pos_restrict_product_stock/static/src/js/ProductScreen.js @@ -6,14 +6,14 @@ import Registries from 'point_of_sale.Registries'; import ProductScreen from 'point_of_sale.ProductScreen'; import { Gui } from 'point_of_sale.Gui'; var models = require('point_of_sale.models'); -models.load_fields('product.product', ['qty_available','virtual_available']); +models.load_fields('product.product', ['qty_available','virtual_available','detailed_type']); const RestrictProductScreen = (ProductScreen) => class RestrictProductScreen extends ProductScreen { async _clickProduct(event) { // Overriding product item click to restrict product out of stock const product = event.detail; var type = this.env.pos.config.stock_type if (this.env.pos.config.is_restrict_product && ((type == 'qty_on_hand') && (product.qty_available <= 0)) | ((type == 'virtual_qty') && (product.virtual_available <= 0)) | - ((product.qty_available <= 0) && (product.virtual_available <= 0))) { + ((product.qty_available <= 0) && (product.virtual_available <= 0)) && (product.detailed_type != 'service' && (!(product.to_weight)))) { // If the product restriction is activated in the settings and quantity is out stock, it show the restrict popup. this.showPopup("RestrictStockPopup", { body: product.display_name, @@ -29,7 +29,7 @@ const RestrictProductScreen = (ProductScreen) => class RestrictProductScreen ext var out_of_stock = false for (let rec of this.env.pos.get_order().orderlines.models) { if (this.env.pos.config.is_restrict_product && ((type == 'qty_on_hand') && (rec.quantity > rec.product.qty_available)) | ((type == 'virtual_qty') && (rec.quantity > rec.product.virtual_available)) | - ((rec.quantity > rec.product.qty_available) && (rec.quantity > rec.product.virtual_available))) { + ((rec.quantity > rec.product.qty_available) && (rec.quantity > rec.product.virtual_available)) && (rec.product.detailed_type != 'service' && (!(rec.product.to_weight)))) { out_of_stock = true this.showPopup("OutOfStockPopup", { body: rec.product.display_name,