diff --git a/erpnext/selling/doctype/product_bundle/product_bundle.py b/erpnext/selling/doctype/product_bundle/product_bundle.py index ef10967f1b099e97a61445b9d7f80c61ef11f164..eba763fa96638b84b074f206ad0e6403cf21f87d 100644 --- a/erpnext/selling/doctype/product_bundle/product_bundle.py +++ b/erpnext/selling/doctype/product_bundle/product_bundle.py @@ -111,7 +111,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))