Negative Stock Control

Per-warehouse negative stock control for ERPNext

Install Negative Stock Control

bench get-app https://github.com/KTA-Endustri-Sistemleri/negative_stock_control

Tags

  • erpnext-module
  • erpnext-tools
  • frappe-app

Add the Frappe Gems badge to your README

Maintain Negative Stock Control? Paste this into your README:

[![Listed on Frappe Gems](https://frappegems.com/api/method/frappe_gems.seo.badge?app=KTA-Endustri-Sistemleri%2Fnegative_stock_control)](https://frappegems.com/gems/apps/KTA-Endustri-Sistemleri/negative_stock_control)

About Negative Stock Control

Negative Stock Control

This application allows restricting negative stock on selected warehouses in ERPNext v15.79.0.
Even if the global Allow Negative Stock setting is enabled, negative stock will be denied for chosen warehouses.


📌 Features

  • Global control: If Stock Settings > Stock Validations > Allow Negative Stock is disabled → no warehouse allows negative stock.
  • Warehouse-based restriction: Even if global is enabled, warehouses listed in Restricted Negative Stock Warehouse are blocked.
  • Flexibility: Warehouses not listed remain unrestricted.

⚙️ Installation

cd frappe-bench
bench get-app https://github.com/KTA-Endustri-Sistemleri/negative_stock_control.git
bench --site sitename install-app negative_stock_control
bench --site sitename migrate

🚀 Usage

  1. Go to Stock Settings in ERPNext.
  2. Enable Allow Negative Stock.
  3. In the new table below, add warehouses where negative stock should be restricted.
  4. Now:
    • Restricted warehouses → ValidationError if negative stock.
    • Other warehouses → negative stock is allowed.

ERPNext App Tests

🧪 Tests

Two scenarios are validated:
1. Negative stock restricted warehouse → must raise error ✅
2. Negative stock non-restricted warehouse → must pass ✅

Run tests:

bench --site sitename run-tests --app negative_stock_control

🔄 Continuous Integration

This repo includes GitHub Actions for automated testing.
Tests run on every push and pull request.

📂 Workflow

Defined in .github/workflows/tests.yml.

✅ Benefits

  • Automatic test on each commit
  • PRs require tests to pass before merge
  • Early bug detection

📜 License

MIT

Related Developer Tools apps for Frappe & ERPNext

  • Frappe — Low code web framework for real world applications, in Python and Javascript
  • Frappe Docker — Docker environment for developing, deploying, and running Frappe applications (ERPNext and custom apps) in production and development
  • Builder — Craft beautiful websites effortlessly with an intuitive visual builder and publish them instantly
  • Bench — CLI to manage Multi-tenant deployments for Frappe apps
  • Frappe Ui — A set of components and utilities for rapid UI development
  • Press — Full service cloud hosting for the Frappe stack - powers Frappe Cloud
  • Gameplan — Open Source Discussions Platform for Remote Teams
  • Doppio — A Frappe app (CLI) to magically setup single page applications and Vue/React powered desk pages on your custom Frappe apps.