InvenTree
InvenTree copied to clipboard
Generate batch code does not generate from PO receive line items
Please verify that this bug has NOT been raised before.
- [X] I checked and didn't find a similar issue
Describe the bug*
When on a PO, receive line items (which generates new stock items) does not automatically generate batch codes.
This may be more of a missing feature but validation plugin function generate_batch_code feels incomplete without functionality in POs.
Steps to Reproduce
Using a Inventree server with plugins enabled
- enable a verification plugin, the sample verification plugin works
- Go to a PO with unreceived line items
- Click to receive all line items or receive an individual item
- Click to add a batch code
- A code is not auto-generated
Expected behaviour
When a batch code is added to a line item in the receive menu it should autofill the entry with a code generated from the generate_batch_code function.
Deployment Method
- [X] Docker
- [ ] Bare metal
Version Information
Version Information:
InvenTree-Version: 0.13.0 dev Django Version: 3.2.20 Commit Hash: 01f2aa5 Commit Date: 2023-07-12 Commit Branch: master Database: postgresql Debug-Mode: True Deployed using Docker: True Platform: Linux-4.18.0-513.9.1.el8_9.x86_64-x86_64-with Installer: DOC
Active plugins: [{'name': 'InvenTreeBarcode', 'slug': 'inventreebarcode', 'version': '2.0.0'}, {'name': 'InvenTreeCoreNotificationsPlugin', 'slug': 'inventreecorenotificationsplugin', 'version': '1.0.0'}, {'name': 'EventPlugin', 'slug': 'sampleevent', 'version': None}, {'name': 'CustomValidator', 'slug': 'validator', 'version': '0.3.0'}, {'name': 'AVL Demo', 'slug': 'companyavldemo', 'version': '0.1.0'}]
Please verify if you can reproduce this bug on the demo site.
- [ ] I can reproduce this bug on the demo site.
Relevant log output
No response
Upvote & Fund
- We're using Polar.sh so you can upvote and help fund this issue.
- We receive the funding once the issue is completed & confirmed by you.
- Thank you in advance for helping prioritize & fund our backlog.
@Elitearcanist thanks for reporting. This will be a slightly tricky one to address, due to the way that default field values / validation is handled, but I'll look into it!
I also noticed that when a new build order is created that it doesn't fill the batch code section. It does however fill in the batch code section when creating a build output. I understand that the build order batch code output serves a different purpose than build output batch codes. Would it be possible to give plugins control over auto generating build order batch codes?
While it is certainly possible technically I do not see any of the core team spending time on it soon if no-one needs it. Feature requests implementation is pretty much driven by use cases by the devs.
Would it be possible to give plugins control over auto generating build order batch codes?
I also noticed that when a new build order is created that it doesn't fill the batch code section
@Elitearcanist I have been considering a framework for a more flexible generation on serials / batch codes / IPN - perhaps if you are looking for this you would be willing to sponsor the development of this to give it priority?
Related issue: https://github.com/inventree/InvenTree/issues/6098
This is closed in https://github.com/inventree/InvenTree/pull/7000
Note: Only implemented in the new interface (React / PUI)