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

Added idx context variable #68

Closed wolflu05 closed 8 months ago

wolflu05 commented 8 months ago

This PR adds the idx context variable like requested in https://github.com/wolflu05/inventree-bulk-plugin/issues/60#issuecomment-1936381866 .

image

{"name":"","template_type":"STOCK_LOCATION","template":{"version":"1.2.1","input":{},"templates":[],"output":{"parent_name_match":"true","dimensions":["*NUMERIC","*ALPHA"],"count":["5","2"],"generate":{"name":"{{idx+1}} {{dim.1}}({{dim.1.idx}})-{{dim.2}}({{dim.2.idx}})"}}}}
github-actions[bot] commented 8 months ago

Coverage Report

Code Coverage Name Stmts Miss Cover Missing
inventree_bulk_plugin/BulkGenerator/BulkGenerator.py 167 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 29 0 100%
inventree_bulk_plugin/BulkGenerator/utils.py 19 0 100%
inventree_bulk_plugin/BulkGenerator/validations.py 54 0 100%
inventree_bulk_plugin/InvenTreeBulkPlugin.py 47 0 100%
inventree_bulk_plugin/api.py 69 0 100%
inventree_bulk_plugin/bulkcreate_objects.py 319 0 100%
inventree_bulk_plugin/migrations/0001_initial.py 6 0 100%
inventree_bulk_plugin/models.py 21 0 100%
inventree_bulk_plugin/serializers.py 53 0 100%
inventree_bulk_plugin/version.py 1 0 100%
TOTAL 934 0 100%