ERPNext Conference 2019* ERPNext.com Blog

Batch ID on Item Template and Item Variants


#1

I have an Item Template that has 4 variants. I checked the ‘has batch no’ option on the item template and also on the item variants.

I’ve created a batch ID for the item template and would like to use this id on all the item variants.

I receive the different item variants -based on quantity- from the supplier in the same batch.

For example if I will receive item variant ALBS-120ml and ALBS-1L in the same batch with the same batch ID.

How can I use the same batch ID on both variants?

So far I’m getting an error when I try to use the item template batch ID that says 256985632 is not a valid Batch Number for Item ALBS-1L”.

What’s the best way to go around this?


#2

Have you got it?


#3

@xickomesquita I used a workaround by adding the item quantity to the variant’s batch number e.g. 256985632-1L for a 1 Litre variant. When printing the batch number on the invoice, I then use the code below to truncate the batch number on the print.

{{ item.batch_no.split("-")[0] | lower }}