From 9e830ec711175fa857235faafeb547352383cd5e Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 8 Feb 2013 20:08:46 +0530 Subject: [PATCH] show sub item group items only if show in website is checked for them --- website/helpers/product.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/website/helpers/product.py b/website/helpers/product.py index 623ceeee34..2685d10ed8 100644 --- a/website/helpers/product.py +++ b/website/helpers/product.py @@ -29,6 +29,8 @@ def get_product_info(item_code): @webnotes.whitelist(allow_guest=True) def get_product_list(search=None, product_group=None, start=0, limit=10): + # DOUBT: why is product_group param passed? + # base query query = """select name, item_name, page_name, website_image, item_group, web_long_description as website_description @@ -70,8 +72,8 @@ def get_product_list_for_group(product_group=None, start=0, limit=10): def get_child_groups(item_group_name): item_group = webnotes.doc("Item Group", item_group_name) return webnotes.conn.sql("""select name - from `tabItem Group` where lft>=%(lft)s and rgt<=%(rgt)s""" \ - % item_group.fields) + from `tabItem Group` where lft>=%(lft)s and rgt<=%(rgt)s + and show_in_website = 1""", item_group.fields) def get_group_item_count(item_group): child_groups = ", ".join(['"' + i[0] + '"' for i in get_child_groups(item_group)])