fix: On Specific case if no item code in name
This commit is contained in:
		
							parent
							
								
									0c0604b7ee
								
							
						
					
					
						commit
						28a7ce9a50
					
				| @ -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) | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user