Skip to content

Commit

Permalink
[17.0][UPD] deltatech_stock_negative
Browse files Browse the repository at this point in the history
  • Loading branch information
VoicuStefan2001 committed Jan 20, 2025
1 parent 1eb9e30 commit 060d524
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion deltatech_stock_negative/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
7 changes: 6 additions & 1 deletion deltatech_stock_negative/models/stock.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down

0 comments on commit 060d524

Please sign in to comment.