wolflu05 / inventree-bulk-plugin

A bulk creation plugin for InvenTree, which helps you generating locations, categories and even parts in bulk by using customized naming strategies and ensure them along your complete storage tree.
MIT License
17 stars 1 forks source link

Input variables on all keys #28

Closed wolflu05 closed 1 year ago

wolflu05 commented 1 year ago

This PR allows the usage of input variables on all fields. It also refactored the template syntax to use jinja2 templates which offer way more functionality than pythons .format(...) function.

⚠️ Breaking

This PR changes the bulk creation syntax in a breaking way.

  1. Arguments for generators are now wrapped in round brackets, *NUMERIC{count=1} ==> *NUMERIC(count=1)
  2. Accessing variables now need double curly brackets instead of single one, {dim.1} ==> {{dim.1}} (This change is due to the integration if the Jinja2 templating engine)

Todo

fixes #10

github-actions[bot] commented 1 year ago

Coverage Report

Code Coverage Name Stmts Miss Cover Missing
inventree_bulk_plugin/BulkGenerator/BulkGenerator.py 94 0 100%
inventree_bulk_plugin/BulkGenerator/dimensions.py 66 0 100%
inventree_bulk_plugin/BulkGenerator/generators/gen_alpha.py 36 0 100%
inventree_bulk_plugin/BulkGenerator/generators/gen_numeric.py 14 0 100%
inventree_bulk_plugin/BulkGenerator/generators/generator.py 33 0 100%
inventree_bulk_plugin/BulkGenerator/template.py 10 0 100%
inventree_bulk_plugin/BulkGenerator/utils.py 2 0 100%
inventree_bulk_plugin/BulkGenerator/validations.py 57 0 100%
inventree_bulk_plugin/InvenTreeBulkPlugin.py 118 0 100%
inventree_bulk_plugin/migrations/0001_initial.py 6 0 100%
inventree_bulk_plugin/models.py 21 0 100%
inventree_bulk_plugin/version.py 1 0 100%
TOTAL 458 0 100%