Go to file
Oliver 906ae218aa
[Plugin] Allow custom plugins for running validation routines (#3776)
* Adds new plugin mixin for performing custom validation steps

* Adds simple test plugin for custom validation

* Run part name and IPN validators checks through loaded plugins

* Expose more validation functions to plugins:

- SalesOrder reference
- PurchaseOrder reference
- BuildOrder reference

* Remove custom validation of reference fields

- For now, this is too complex to consider given the current incrementing-reference implementation
- Might revisit this at a later stage.

* Custom validation of serial numbers:

- Replace "checkIfSerialNumberExists" method with "validate_serial_number"
- Pass serial number through to custom plugins
- General code / docstring improvements

* Update unit tests

* Update InvenTree/stock/tests.py

Co-authored-by: Matthias Mair <code@mjmair.com>

* Adds global setting to specify whether serial numbers must be unique globally

- Default is false to preserve behaviour

* Improved error message when attempting to create stock item with invalid serial numbers

* Add more detail to existing serial error message

* Add unit testing for serial number uniqueness

* Allow plugins to convert a serial number to an integer (for optimized sorting)

* Add placeholder plugin methods for incrementing and decrementing serial numbers

* Typo fix

* Add improved method for determining the "latest" serial number

* Remove calls to getLatestSerialNumber

* Update validate_serial_number method

- Add option to disable checking for duplicates
- Don't pass optional StockItem through to plugins

* Refactor serial number extraction methods

- Expose the "incrementing" portion to external plugins

* Bug fixes

* Update unit tests

* Fix for get_latest_serial_number

* Ensure custom serial integer values are clipped

* Adds a plugin for validating and generating hexadecimal serial numbers

* Update unit tests

* Add stub methods for batch code functionality

* remove "hex serials" plugin

- Was simply breaking unit tests

* Allow custom plugins to generate and validate batch codes

- Perform batch code validation when StockItem is saved
- Improve display of error message in modal forms

* Fix unit tests for stock app

* Log message if plugin has a duplicate slug

* Unit test fix

Co-authored-by: Matthias Mair <code@mjmair.com>
2022-10-18 23:50:07 +11:00
.devcontainer Add db an media backups (#3783) 2022-10-17 00:09:31 +11:00
.github Bump actions to node 16 / current releases (#3799) 2022-10-17 13:46:12 +11:00
.vscode vscode devcontainer (#3474) 2022-08-09 16:06:32 +10:00
ci Improvements to version check CI script (#3455) 2022-08-02 12:11:07 +10:00
contrib Add db an media backups (#3783) 2022-10-17 00:09:31 +11:00
deploy fix endline 2022-05-20 13:35:07 +02:00
docker Add db an media backups (#3783) 2022-10-17 00:09:31 +11:00
images/logo Export large version of the logo 2020-05-12 00:06:26 +10:00
InvenTree [Plugin] Allow custom plugins for running validation routines (#3776) 2022-10-18 23:50:07 +11:00
.eslintrc.yml lots of linting fixes for JS files 2021-09-03 22:54:17 +10:00
.gitattributes fix endline 2022-05-20 13:35:07 +02:00
.gitignore vscode devcontainer (#3474) 2022-08-09 16:06:32 +10:00
.gitpod.yml Add db an media backups (#3783) 2022-10-17 00:09:31 +11:00
.pkgr.yml Add db an media backups (#3783) 2022-10-17 00:09:31 +11:00
.pre-commit-config.yaml update pre-commit (#3744) 2022-10-06 22:32:01 +11:00
CONTRIBUTING.md Update issue templates to GH forms (#3495) 2022-08-08 11:12:52 +10:00
crowdin.yml L10 merge (#1595) 2021-05-18 19:20:24 +10:00
docker-compose.yml Fix for docker-compose v1 (#3434) 2022-07-30 11:43:15 +10:00
docker.dev.env Simplification of development docker-compose file (#3429) 2022-07-30 10:34:16 +10:00
Dockerfile Add postgresql-client to docker image (#3802) 2022-10-17 14:50:05 +11:00
LICENSE Update LICENSE 2022-02-21 22:31:10 +11:00
package-lock.json add packagelock 2021-12-03 01:11:04 +01:00
package.json prefix version in package 2021-12-02 11:33:02 +01:00
Procfile Add package-based install method (#3743) 2022-10-16 10:14:18 +11:00
README.md Add package-based install method (#3743) 2022-10-16 10:14:18 +11:00
RELEASE.md Include 'default' value in OPTIONS request for any fields with specified default values 2021-06-27 21:44:21 +10:00
requirements-dev.in Requirements fix (#3280) 2022-07-02 21:01:01 +10:00
requirements-dev.txt Update deps to newest releases (#3782) 2022-10-13 11:07:06 +11:00
requirements.in Add db an media backups (#3783) 2022-10-17 00:09:31 +11:00
requirements.txt Add db an media backups (#3783) 2022-10-17 00:09:31 +11:00
runtime.txt Add package-based install method (#3743) 2022-10-16 10:14:18 +11:00
SECURITY.md Spelling fix: dates -> days (#3193) 2022-06-14 10:07:48 +10:00
setup.cfg Add more checks to pre-commit (#3132) 2022-06-06 08:56:52 +10:00
tasks.py Add db an media backups (#3783) 2022-10-17 00:09:31 +11:00

InvenTree logo

InvenTree

Open Source Inventory Management System

License: MITGitHub tag (latest SemVer) CI Docker Build

Coveralls Crowdin Lines of code GitHub commit activity Docker Pulls

GitHub Org's stars Twitter Follow Subreddit subscribers

View Demo · Documentation · Report Bug · Request Feature

🌟 About the Project

InvenTree is an open-source Inventory Management System which provides powerful low-level stock control and part tracking. The core of the InvenTree system is a Python/Django database backend which provides an admin interface (web-based) and a REST API for interaction with external interfaces and applications.

InvenTree is designed to be lightweight and easy to use for SME or hobbyist applications, where many existing stock management solutions are bloated and cumbersome to use. Updating stock is a single-action process and does not require a complex system of work orders or stock transactions.

Powerful business logic works in the background to ensure that stock tracking history is maintained, and users have ready access to stock level information.

🎯 Features

  • Organize Parts and BOMs
  • Manage Suppliers
  • Instant Stock Knowledge
  • Extend and Customize to fit your usage

🧭 Roadmap

  • Plugins
  • Improved Importers
  • Custom Workflow Processes

🛠️ Integration

InvenTree is designed to be extensible, and provides multiple options for integration with external applications or addition of custom plugins:

👾 Tech Stack

Server
Database
Client
DevOps

🧰 Getting Started

Refer to the getting started guide for installation and setup instructions.

📱 Mobile App

InvenTree is supported by a companion mobile app which allows users access to stock control information and functionality.

🚋 Deploy

There are several options to deploy InvenTree.

Single line install:

curl https://raw.githubusercontent.com/InvenTree/InvenTree/master/contrib/install.sh | sh

👋 Contributing

Contributions are welcomed and encouraged. Please help to make this project even better! Refer to the contribution page in the docs and check out contributing.md.

📜 Translation

Native language translation of the InvenTree web application is community contributed via crowdin. Contributions are welcomed and encouraged.

To contribute to the translation effort, navigate to the InvenTree crowdin project, create a free account, and start making translations suggestions for your language of choice!

💸 Sponsor

If you use InvenTree and find it to be useful, please consider making a donation toward its continued development.

Donate via PayPal

💎 Acknowledgements

We would like to acknowledge a few special projects:

Find a full list of used third-party libraries in our documentation.

⚠️ License

Distributed under the MIT License. See LICENSE.txt for more information.