From 6f36691c64a8d3883a6e21750f3ed2d4f7bae915 Mon Sep 17 00:00:00 2001 From: thefalconx33 Date: Wed, 11 Dec 2019 16:08:31 +0530 Subject: [PATCH] fix: handle scenario with no condition --- erpnext/portal/product_configurator/utils.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/erpnext/portal/product_configurator/utils.py b/erpnext/portal/product_configurator/utils.py index ab4b82a688b..3ed68362ed2 100644 --- a/erpnext/portal/product_configurator/utils.py +++ b/erpnext/portal/product_configurator/utils.py @@ -335,12 +335,14 @@ def get_items(filters=None, search=None): search_condition = get_conditions(or_filters, 'or') filter_condition = get_conditions(filters, 'and') - - where_conditions = 'disabled = 0 and ' - where_conditions += ' and '.join( + where_conditions = ' and '.join( [condition for condition in [show_in_website_condition, search_condition, filter_condition] if condition] ) + if where_conditions: + where_conditions += ' and disabled = 0' + else: + where_conditions += 'disabled = 0' left_joins = [] for f in filters: