mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-07 07:02:54 +00:00
fix: On Specific case if no item code in name (#19419)
This commit is contained in:
committed by
Nabin Hait
parent
e127d937f7
commit
5c9d92eabf
@@ -39,11 +39,13 @@ class BOM(WebsiteGenerator):
|
||||
names = [d[-1][1:] for d in filter(lambda x: len(x) > 1 and x[-1], names)]
|
||||
|
||||
# split by (-) if cancelled
|
||||
if names:
|
||||
names = [cint(name.split('-')[-1]) for name in names]
|
||||
|
||||
idx = max(names) + 1
|
||||
else:
|
||||
idx = 1
|
||||
else:
|
||||
idx = 1
|
||||
|
||||
self.name = 'BOM-' + self.item + ('-%.3i' % idx)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user