From 060d524df186ef7d3c3d9f8fe4c3017f9856b540 Mon Sep 17 00:00:00 2001 From: VoicuStefan2001 Date: Mon, 20 Jan 2025 14:23:33 +0200 Subject: [PATCH] [17.0][UPD] deltatech_stock_negative --- deltatech_stock_negative/__manifest__.py | 2 +- deltatech_stock_negative/models/stock.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/deltatech_stock_negative/__manifest__.py b/deltatech_stock_negative/__manifest__.py index b52c42be9..f9aea1acf 100644 --- a/deltatech_stock_negative/__manifest__.py +++ b/deltatech_stock_negative/__manifest__.py @@ -4,7 +4,7 @@ { "name": "No Negative Stock", "summary": "Negative stocks are not allowed", - "version": "17.0.2.0.4", + "version": "17.0.2.0.5", "author": "Terrabit, Dorin Hongu", "website": "https://www.terrabit.ro", "category": "Generic Modules/Stock", diff --git a/deltatech_stock_negative/models/stock.py b/deltatech_stock_negative/models/stock.py index 1d0057f1f..e558d0411 100644 --- a/deltatech_stock_negative/models/stock.py +++ b/deltatech_stock_negative/models/stock.py @@ -25,7 +25,12 @@ def _get_available_quantity( if not company.no_negative_stock: return res - if location_id and not location_id.allow_negative_stock and res < 0.0 and location_id.usage == "internal": + if ( + location_id + and not location_id.allow_negative_stock + and round(res, 2) < 0.0 + and location_id.usage == "internal" + ): err = _( "You have chosen to avoid negative stock. %(lot_qty)s pieces of %(product_name)s are remaining in location %(location_name)s. " "Please adjust your quantities or correct your stock with an inventory adjustment."