Item Code auto generation

No need to any script and all programming skill…
Create item group what you want and then go to document naming rule and follow my this post.

This post considering journal entry doctype.

  1. you can select “item” in document type field
  2. make it rule condition field in item_group = <Your_item_group_list> like Finished Goods
  3. set prefix what you want like FG.-.
  4. Finally, set digit like 5

so once you create item then generate code like FG-00001