InvenTree plugin to automatically generate and assign Internal Part Numbers to parts
Project description
Introduction
This is a plugin for InvenTree. Installing this plugin enables the automatic generation if Internal Part Numbers (IPN) for parts.
Installation
To automatically install the plugin when running invoke install
:
Add inventree-ipn-generator
to your plugins.txt file.
Or, install the plugin manually:
pip install inventree-ipn-generator
For the plugin to be listed as available, you need to enable "Event Integration" in your plugin settings. This setting is located with the Plugin Settings on the settings page.
Settings
- Active - Enables toggling of plugin without having to disable it
- On Create - If on, the plugin will assign IPNs to newly created parts
- On Change - If on, the plugin will assign IPNs to parts after a change has been made. Enabling this setting will remove the ability to have parts without IPNs.
Pattern
Part Number patterns follow three basic groups. Literals, Numerics, and characters. When incrementing a part number, the rightmost group that is mutable will be incremented. All groups can be combined in any order.
A pattern cannot consist of only Literals.
Literals (Immutable)
Anything encased in ()
will be rendered as-is. no change will be made to anything within.
Example: (A6C)
will always render as "A6C", regardless of other groups
Numeric
Numbers that should change over time should be encased in {}
{5}
respresents a number with max 5 digits{25+}
represents a number 25-99
Example: {5+}{3}
will result in this range: 5000-5999
Characters
Characters that change should be encased in []
[abc]
represents looping through the lettersa
,b
,c
in order.[a-f]
represents looping through the letters froma
tof
alphabetaically
These two directives can be combined.
[aQc-f]
represents:-
a
,Q
,c-f
Examples
(AB){3}[ab]
-> AB001a, AB001b, AB002a, AB021b, AB032a, etc{2}[Aq](BD)
-> 01ABD, 01qBD, 02ABD, 02qBD, etc{1}[a-d]{8+}
-> 1a8, 1a9, 1b8, 1b9, 1c8, 1c9, 1d8, 1d9, 2a8, etc
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for inventree-ipn-generator-0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ef375bac6c646c6b774c0ad608bc6037affb45cb5e4ec89856833cb8e43a88c |
|
MD5 | 461dec12e4a30b5873085a02dff8ab5f |
|
BLAKE2b-256 | 18554d277423afdea363eab00ea302702a979ad30649cab1858251b9457e752d |
Hashes for inventree_ipn_generator-0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | baba9cd747a682b23eba007be46026dcee30705eaf59bf0ad165a2b95b23840f |
|
MD5 | 221f4cd3220d11348c9f2ab71523f8d2 |
|
BLAKE2b-256 | 255053bff59bb3fcb51817df2c62e451d8552622868464f1df230cf8fa6a60b6 |