Skip to content

Commit

Permalink
fix: if naming if item-code and index both are same (#19372)
Browse files Browse the repository at this point in the history
  • Loading branch information
Anurag810 authored and nabinhait committed Oct 22, 2019
1 parent 8957093 commit 5a2ea52
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion erpnext/manufacturing/doctype/bom/bom.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ def autoname(self):
# name can be BOM/ITEM/001, BOM/ITEM/001-1, BOM-ITEM-001, BOM-ITEM-001-1

# split by item
names = [name.split(self.item)[-1][1:] for name in names]
names = [name.split(self.item, 1) for name in names]
names = [d[-1][1:] for d in filter(lambda x: len(x) > 1 and x[-1], names)]

# split by (-) if cancelled
names = [cint(name.split('-')[-1]) for name in names]
Expand Down

0 comments on commit 5a2ea52

Please sign in to comment.