Skip to content

Commit

Permalink
Merge pull request #1887 from VoicuStefan2001/17.0
Browse files Browse the repository at this point in the history
[17.0][UPD] deltatech_stock_negative
  • Loading branch information
VoicuStefan2001 authored Jan 20, 2025
2 parents d963e01 + f967dde commit 686f820
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ addon | version | maintainers | summary | price
[deltatech_stock_date](deltatech_stock_date/) | 17.0.1.1.0 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Obsolete use l10n_ro_stock_account_date | Free
[deltatech_stock_delivery](deltatech_stock_delivery/) | 17.0.1.0.0 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Adding button in invoice for display reception or delivery | Free
[deltatech_stock_inventory](deltatech_stock_inventory/) | 17.0.2.3.2 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Inventory Old Method | Free
[deltatech_stock_negative](deltatech_stock_negative/) | 17.0.2.0.4 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Negative stocks are not allowed | Free
[deltatech_stock_negative](deltatech_stock_negative/) | 17.0.2.0.5 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Negative stocks are not allowed | Free
[deltatech_stock_report](deltatech_stock_report/) | 17.0.1.0.3 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Report with positions from picking lists | Free
[deltatech_stock_reseller](deltatech_stock_reseller/) | 17.0.1.0.1 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Report report reseller | Free
[deltatech_stock_sn](deltatech_stock_sn/) | 17.0.1.0.0 | | Stock Serial Number | Free
Expand Down
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 686f820

Please sign in to comment.