InvenTree icon indicating copy to clipboard operation
InvenTree copied to clipboard

Generate batch code does not generate from PO receive line items

Open Elitearcanist opened this issue 1 year ago • 5 comments

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

  1. enable a verification plugin, the sample verification plugin works
  2. Go to a PO with unreceived line items
  3. Click to receive all line items or receive an individual item
  4. Click to add a batch code
  5. 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.
Fund with Polar

Elitearcanist avatar Jan 30 '24 01:01 Elitearcanist

@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!

SchrodingersGat avatar Jan 30 '24 10:01 SchrodingersGat

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?

Elitearcanist avatar Jan 30 '24 18:01 Elitearcanist

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.

matmair avatar Jan 30 '24 20:01 matmair

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?

SchrodingersGat avatar Jan 31 '24 10:01 SchrodingersGat

Related issue: https://github.com/inventree/InvenTree/issues/6098

SchrodingersGat avatar Feb 15 '24 01:02 SchrodingersGat

This is closed in https://github.com/inventree/InvenTree/pull/7000

Note: Only implemented in the new interface (React / PUI)

SchrodingersGat avatar May 20 '24 13:05 SchrodingersGat