fix: if naming if item-code and index both are same (#19371)

This commit is contained in:
Anurag Mishra 2019-10-22 11:47:03 +05:30 committed by Nabin Hait
parent eaff541349
commit b7e9e2a1a5

View File

@ -35,7 +35,8 @@ class BOM(WebsiteGenerator):
# name can be BOM/ITEM/001, BOM/ITEM/001-1, BOM-ITEM-001, BOM-ITEM-001-1 # name can be BOM/ITEM/001, BOM/ITEM/001-1, BOM-ITEM-001, BOM-ITEM-001-1
# split by item # 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 # split by (-) if cancelled
names = [cint(name.split('-')[-1]) for name in names] names = [cint(name.split('-')[-1]) for name in names]