From d1c5297a48c284bbccb289e23de56a4603165059 Mon Sep 17 00:00:00 2001 From: Charles-Henri Decultot Date: Tue, 21 Jan 2025 15:32:28 +0100 Subject: [PATCH] fix: Strip fieldname as there may be whitespaces --- erpnext/selling/doctype/product_bundle/product_bundle.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/erpnext/selling/doctype/product_bundle/product_bundle.py b/erpnext/selling/doctype/product_bundle/product_bundle.py index 938869c712..4306a5e4a3 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)) -- GitLab