2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-22 23:00:54 +00:00

Add database model for defining custom units (#5268)

* Add database model for defining custom units

- Database model
- DRF serializer
- API endpoints

* Add validation hook

* Custom check for the 'definition' field

* Add settings page for custom units

- Table of units
- Create / edit / delete buttons

* Allow "unit" field to be empty

- Not actually required for custom unit definition

* Load custom unit definitions into global registry

* Docs: add core concepts page(s)

* Add some back links

* Update docs

* Add unit test for custom unit conversion

* More unit testing

* remove print statements

* Add missing table rule
This commit is contained in:
Oliver
2023-07-19 06:24:16 +10:00
committed by GitHub
parent 81e2c2f8fa
commit 6d3978ea28
17 changed files with 458 additions and 25 deletions

View File

@ -0,0 +1,40 @@
---
title: Terminology
---
## Terminology
There are different systems in the industry for the management of getting, storing and making parts. An overview what they are for and what the acronyms mean.
**InvenTree** is mainly focused on [**IMS**](#inventory-management-system-ims) and [**PLM**](#part-library-management-plm) functionality.
### Inventory Management System *(IMS)*
Evolves around manufacturing of parts out of other parts. It keeps track of stock, part origin, orders, shelf live and more.
### Part Library Management *(PLM)*
Keeps track of BOMs, part variants, possible substitutions, versions, IPNs and further part parameters.
PLM can also mean product lifecycle management those systems manage all stages from design through manufacturing up to customer support and recycling.
A similar system is [Partkeepr](https://partkeepr.org/) (seems mostly inactive - there is a 3rd party importer).
### Material Resource Planning *(MRP)*
Material Requirements Planning software, is designed to assist businesses in effectively managing their manufacturing processes. It helps with the planning and control of inventory, production schedules, and procurement activities. MRP software utilizes various algorithms and data inputs, such as sales forecasts, production capacity, and bill of materials, to generate material requirements plans, schedule production orders, and optimize inventory levels.
### Asset Management *(AM)*
Manages many unique items, which need tracking per part and are assignable to users / groups / locations. These systems often include features like item states, refurbishing / maintenance / reservation, or request-flows.
Often these systems are used for IT-Hardware (then they are called *ITAM*).
A good open-source example would be [Snipe-IT](https://snipeitapp.com/).
### Enterprise Resource Planning *(ERP)*
Is the centre of your business. It manages timesheets, warehousing, finances (prices, taxes, …), customer relations and more. InvenTree covers parts of this but aims to keep an intuitive and simple user interface.
Popular, fully fledged ERPs are [ERPNext](https://erpnext.com/) or [odoo](https://www.odoo.com).
### Customer Relationship Manager *(CRM)*
Customer relationship management (CRM) is a technology for managing all your company's relationships and interactions with customers and potential customers.
### Manufacturing Execution System *(MES)*
A Manufacturing Execution System (MES), oversees, monitors, records, and manages the entire manufacturing process from raw materials to finalized products.

View File

@ -0,0 +1,41 @@
---
title: Physical Units
---
## Physical Units
Support for real-world "physical" units of measure is implemented using the [pint](https://pint.readthedocs.io/en/stable/) Python library. This library provides the following core functions:
- Ensures consistent use of real units for your inventory management
- Convert between compatible units of measure from suppliers
- Enforce use of compatible units when creating part parameters
- Enable custom units as required
## Unit Support
Physical units are supported by the following InvenTree subsystems:
### Part
The [unit of measure](../part/part.md#units-of-measure) field for the [Part](../part/part.md) model uses real-world units.
### Supplier Part
The [supplier part](../part/part/#supplier-parts) model uses real-world units to convert between supplier part quantities and internal stock quantities. Unit conversion rules ensure that only compatible unit types can be supplied
### Part Parameter
The [part parameter template](../part/parameter.md#parameter-templates) model can specify units of measure, and part parameters can be specified against these templates with compatible units
## Custom Units
Out of the box, the Pint library provides a wide range of units for use. However, it may not be sufficient for a given application. In such cases, custom units can be easily defined to meet custom requirements.
Custom units can be defined to provide a new physical quantity, link existing units together, or simply provide an alias for an existing unit.
!!! tip "More Info"
For further information, refer to the [pint documentation](https://pint.readthedocs.io/en/stable/advanced/defining.html) regarding custom unit definition
### Create Custom Units
To view, edit and create custom units, locate the *Physical Units* tab in the [settings panel](../settings/global.md).