This plugin helps you bulk create storage locations and part categories in InvenTree by using customized naming strategies. That means you not only have the option to generate multidimensional* names for stock locations or part categories, but also have the option to save the templates for later usage if your storage room uses e.g. drawer towers, saved templates help to ensure naming consistency for all later added towers.
--multidimensional means that you are not limited to namings like
+D1
,D2
, .. but also something likeD1.A
,D1.B
,D2.A
,D2.B
, …ℹ️ * multidimensional means that you are not limited to namings like
D1
,D2
, .. but also something likeD1.A
,D1.B
,D2.A
,D2.B
, …
This will generate the previous mentioned example:
-If you want to try out the templates on you’re own, you can just copy the below json to your clipboard and use the “New untitled schema from clipboard” button to import them (see import/export). For more examples refer to the plugin documentation.
-{"name":"Example","template_type":"STOCK_LOCATION","template":{"version":"1.0.0","input":{},"templates":[],"output":{"parent_name_match":"true","dimensions":["*NUMERIC","*ALPHA"],"count":["3","2"],"generate":{"name":"D."},"childs":[]}}}
+
Install this plugin as follows:
Make sure you allow the use of the url integration and app integration (see Why does this plugin needs the app mixin?)
-Goto Settings > Plugins > Install Plugin, enter inventree-bulk-plugin
as package name. Enable the confirm switch and click submit.
Restart your server and activate the plugin.
-Stop your server and run invoke update
(for docker installs it is docker-compose inventree-server invoke update
). This ensures that all migrations run and the static files get collected. You can now start your server again and start using the plugin.
You can bulk create sub-stocklocations and sub-partcategories. Goto one and use the panel “Bulk-creation”. Either load a saved template or set up the output quickly. Use “Preview” to see how the bulk creation will look like and create to bulk create the locations/categories. To see how this editor works see bulk creation editor.
- -You can save bulk creation templates to ensure consistency along your storage trees. Let’s say you have a bunch of drawer towers. With saved templates you can now easily store your templates to re-use it when you want to add a new tower to the system.
- -inventree-bulk-plugin
as package name. Enable the confirm switch and click submit.invoke update
(for docker installs it is docker-compose inventree-server invoke update
). This ensures that all migrations run and the static files get collected. You can now start your server again and start using the plugin.--You can use inputs to make your bulk creation schema dynamic in amount of drawers or their names.
+❗At least InvenTree v0.12.7 is required to use this plugin.
The bulk creation editor helps you to define the generation schema.
- --- -You can use Jinja2 templating in every field (except in the
-input
section). You can also use filters to manipulate the dimension output. -Global context:-
-- -
-inp.<key>
- Access input variables, e.g. (``)
You can define key/value pairs of inputs which you can later reference in your schema via ``. This is useful for saved templates to dynamically generate the amount of locations as you want, but still keep the structure.
- -You can define templates from which you can later extend in your output. Template values can also be overwritten.
- -Template name
- Template name, is later used to select for extendingFor the rest of the fields see output.
- -First child that matches the parent name matcher will be chosen for generating the child’s for a specific parent. This must evaluate to something that can be casted to a boolean. You can use Jinja2 for dynamically decide based on the parent. E.g. ``. The global jinja2 and par
context is available here.
Select a template to extend from
- -Dimensions are a way to add various counting strategies to your naming. You can add a dimension by clicking on “Add dimension” and remove it via the red “X” on the right of the dimension field.
- -A dimension
can contain comma separated generators which generate the values for you. There are three types of generators. You can use the count
field to limit a dimension to a specific amount of generating items. These generators can have arguments parsed via the following syntax: GENERATOR(key1=value,key2=value)
, where GENERATOR
is the name/range.
Generator types:
-Word: any arbitrary word, not starting with *
. E.g. hello world
-Ranges: ranges are defined with a - in the middle E.g. a-bx
-Infinity: infinity generators start with a * E.g. *NUMERIC
Available Generators:
-Numeric generator: *NUMERIC(start=0,end=10,step=2,count=5)
or 0-10(step=2}
-Alpha generator: *ALPHA(casing=upper|lower,start=A,end=F,step=2,count=3)
or a-z(step=2)
Example: 1-3,hello,*NUMERIC(start=1,step=2,end=10),*ALPHA(casing=upper,end=B),A-D(step=2)
, this will generate the following dimension: 12,3,hello,1,3,5,7,9,A,B,A,C
.
-- -Infinity generators need a
-count
argument or a global count limitation, otherwise generation will fail.
These fields my differ between stock location and part category. They correspond to the generated items property. For example “Name” will be the name of the created location/category. Fields like “Structural” must evaluate to something that ca be casted to a boolean (e.g. true
or false
).
-- -Extended Jinja2 context:
--
-- -
-len
- count of elements this child will generate- -
-dim.<x>
- x-th dimension, one-based (e.g. `` to access the first dimension)- -
-dim.<x>.len
- count of items the x-th dimension has- -
-par.<...>
- parent’s context- -
-par.dim.<x>
- parents’s dimensions- -
-par.gen.<name>
- parent’s generated fields (e.g. to reuse the parents name ``)- -
-par.par.<...>
- parent’s parent context, can be nested deeply
Child’s are a way to add some nesting to your bulk creation tree. You can use them for e.g. generating sections in every of your drawer. You can use the Parent name match option to add for your drawers named from Drawer 1
- Drawer 10
two sections while your other drawers have different sections.
-- -This plugin uses the App Mixin to add a custom model to the database to manage stored templates which ensure consistency along your creation of storage trees. (See Saved templates). Additionally the App Mixin is used to provide the static files that are required for the reactive interface powered by preact.
-
-+This plugin uses the Url Mixin to expose custom API endpoints for previewing and bulk create locations.
-
Refer to the plugin documentation for further examples, instructions and information.
diff --git a/wolflu05/inventree-cups-plugin.html b/wolflu05/inventree-cups-plugin.html index 3f1a7fc3..9070f621 100644 --- a/wolflu05/inventree-cups-plugin.html +++ b/wolflu05/inventree-cups-plugin.html @@ -31,11 +31,11 @@ - + +{"@context":"https://schema.org","@type":"BlogPosting","author":{"@type":"Person","name":"wolflu05"},"dateModified":"2023-09-20T23:38:15+00:00","datePublished":"2023-09-20T23:38:15+00:00","description":"Label printing plugin for generic cups printers","headline":"Inventree Cups Plugin","mainEntityOfPage":{"@type":"WebPage","@id":"/wolflu05/inventree-cups-plugin"},"url":"/wolflu05/inventree-cups-plugin"}