Merge pull request #26413 from MTronics/issue_#26343_CAM_relation_to_stock_gets_lost
Issue #26343: CAM Tasks panel ignores selected Stock
This commit is contained in:
@@ -717,7 +717,13 @@ class StockFromExistingEdit(StockEdit):
|
||||
for i, solid in enumerate(self.candidates(obj)):
|
||||
self.form.stockExisting.addItem(solid.Label, solid)
|
||||
label = "{}-{}".format(self.StockLabelPrefix, solid.Label)
|
||||
if label == stockName:
|
||||
|
||||
# stockName has index suffix (since cloned), label has no index
|
||||
# => ridgid string comparison fails
|
||||
# Instead of ridgid string comparsion use partial (needle in haystack)
|
||||
# string comparison
|
||||
# if label == stockName: # ridgid string comparison
|
||||
if label in stockName: # partial string comparison
|
||||
index = i
|
||||
|
||||
self.form.stockExisting.setCurrentIndex(index if index != -1 else 0)
|
||||
|
||||
Reference in New Issue
Block a user