Generate Item Code Based On Custom Logic
Add this Custom Script in the script of Item, so that the new Item Code is
generated just before the Item gets saved.
cur_frm.cscript.customvalidate = function (doc) {
// clear itemcode (name is from itemcode)
doc.itemcode = \