diff --git a/erpnext/selling/doctype/product_bundle/product_bundle.py b/erpnext/selling/doctype/product_bundle/product_bundle.py index 938869c7125da46041878ff753659051fb99de23..4306a5e4a34275bce7eaa99dc948f1462f17ffe4 100644 --- a/erpnext/selling/doctype/product_bundle/product_bundle.py +++ b/erpnext/selling/doctype/product_bundle/product_bundle.py @@ -94,7 +94,9 @@ def get_new_item_code(doctype, txt, searchfield, start, page_len, filters): ) if searchfield: - query = query.where(Criterion.any([item[fieldname].like(f"%{txt}%") for fieldname in searchfield])) + query = query.where( + Criterion.any([item[fieldname.strip()].like(f"%{txt}%") for fieldname in searchfield]) + ) if product_bundles: query = query.where(item.name.notin(product_bundles))