From 7ef1ccbe8489d38168517758a8badfde2c1dc6fb Mon Sep 17 00:00:00 2001 From: marination Date: Mon, 4 Apr 2022 12:04:35 +0530 Subject: [PATCH] fix: Add default score of 1 to Item Group Autocompleter - If score 0 is inserted into suggestions, RS does not consider that suggestion --- erpnext/e_commerce/redisearch_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/e_commerce/redisearch_utils.py b/erpnext/e_commerce/redisearch_utils.py index 95b74e0795c..b2f97e308c4 100644 --- a/erpnext/e_commerce/redisearch_utils.py +++ b/erpnext/e_commerce/redisearch_utils.py @@ -209,7 +209,7 @@ def create_item_groups_autocomplete_dict(autocompleter): autocompleter.add_suggestions( Suggestion( string=item_group.name, - score=item_group.weightage, + score=frappe.utils.flt(item_group.weightage) or 1.0, payload=payload, # additional info that can be retrieved later ) )