Auto Create Batch During Stock Entry

I looking for a functionality to auto create Batch during Stock entry with Batch ID from Stock Entry item custom field. Is anybody have the same use can and successful in implementing. Appreciate sharing your solution.

What is your scenario/use case? So I can understand it better.

When you material receipt type set in stock entry, then it will create a batch automatically if enabled the “Automatically Create New Batch” in Item master.

The ERPNext set-up is Batch ready and can be enabled any time. Tested Ok to auto generate Batch IDs when enabled. But the client would like to manually key in the number series for their own control in Stock Entry item custom field that will be inherited to become the Batch ID. It is needed for type Material Receipt. My use case is type Repack.

@pmjd Need this for Repack operations. Client would like to control their own Batch ID series which will be inherited from parent Stock Entry Repack item custom field. Appreciate any idea.

Probably a SAP WM wannabe :slight_smile: I advise you use Workflow. Otherwise you need to override many methods.
Your case is I guess the customer wants to welcome the auto created batch but also wantsnto split the batch thus, creating new bins.

Your right the client is migrating from SAP WM and they would like to retain their old methods. Can workflow really handle this use case? Have not thought about that. I will try to make a few spins.

I reviewed Workflow documentation and I reckon it more on document Approval. Possibly to create a Workflow State - Create Batch! But then again, I cannot see any functionality that would create Batch from Stock Entry Detail item custom field.

I am thinking that this can be accomplish by a Client Script. Wish me luck, I will share the script here.

I would not recommend to place this code on client side. There will be server functions that will execute and complicate the process.
Here’s what I have to offer:

  1. Do regular Purchase Receipt. The Item should have Automatic Batch enabled.
  2. Go to received Stock. Determine Batches and Split them via a Material Transfer of type Split in the receiving warehouse.
  3. The responsible person will do Material Transfer to incoming quality control warehouse and while doing this, will check QI required check on the Transfer. Here you can put a client script to control source warehouse (incoming) and destination warehouse (quality control) and get this field checked. You can even place a block via client script not to move material to other destinations. That would make better sense.
    Here, you would have another problem as to which Template to use for QI.