Ensuring OEM Serial numbers uniqueness

Hello,

I use in manufacturing several products with very similar serial number series. It is only a matter of time when they match. So I decided to “wrap” the OEM/MFR serial with my own, ERPNEXT-generated and guaranteedly unique serial. It was relatively easy to add a custom field “custom_mfr_ser” to store that psuedo-unique serail and define the series for generating my own. But then I ran into a problem. I want to continue using the Purchase Infoice and Reciept forms to scan the OEM barcodes on item arrival, but the ERPNEXT hardcoded saving the scanned codes into “serial_no” and “name” fields. So far, one option I found is to rewrite the make_serial_nos() from serial_and_batch_bundle.py to save them in the “custom_mfr_ser” field - which looks a bit clumsy and dangerous. And another one to use doc_events hook on Purchase Receipt / Purchase Invoice before_submit + after_submit, but I am not sure if that is all what is needed to change: the new field must be used in parallel with old ones during all operations with serials - e.g. search, reporting…

So I would like to ask if there is a better way to solve that? I tried to find something on the subject, but only got the same question raised 2 years ago with no answers…

I love that community spirit - to answer to my posts myself after a month… :slight_smile:

Anyway, I created a frappe app that allows to wrap the manufacturer/supplier serial number into a locally generated, unique serial number.

What is can:

  • allows identical manufacturer serials of different items.
  • generation of unique local (your own) serials for all parts .
  • possible to define a pattern for each and/or all locally generated serials
  • search and item selection (e.g. by barcode scanner) by both local_ser and mfr_ser.
  • upgrade scripts to align the existing serials to the new mode if needed (it fully supports the old style serial numbers too)

The latest version is now installed in my production. Lots of bugs are already fixed, but probably some are still there, since my company is not using all possible paths in ERPNEXT.
If there is anyone interested, let me know, I can share the app and will try to support with hints/bugfixing as far as I can.

1 Like

this is a valid business case, I am interested to see your working solution (app).

thanks for sharing.

Hi @igor-k

You know what they say - the mind that has the question has the answer

So what I suggest is you put the app on github and make it public. Then you advertise on community marketplace so that others benefit also:-