From 22aa17bcce2d41050b4e0f4ca8d77f330f645f5f Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 29 Feb 2012 10:44:27 +0530 Subject: [PATCH] changes in trend analyzer query --- .../analysis/search_criteria/trend_analyzer/trend_analyzer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/analysis/search_criteria/trend_analyzer/trend_analyzer.py b/erpnext/analysis/search_criteria/trend_analyzer/trend_analyzer.py index ad5718154b..2198204894 100644 --- a/erpnext/analysis/search_criteria/trend_analyzer/trend_analyzer.py +++ b/erpnext/analysis/search_criteria/trend_analyzer/trend_analyzer.py @@ -107,7 +107,7 @@ if item or based_on == 'Item': # Item Group if item_group or based_on == 'Item Group': add_tab += ' ,`tabItem` t3, `tabItem Group` t4 ' - add_cond += ' AND t3.name = t2.item_code AND t3.item_group = t4.name and (t4.name = "%s" or t4.name IN (SELECT t5.name FROM `tabItem Group` t5,`tabItem Group` t6 WHERE t5.lft BETWEEN t6.lft and t6.rgt and t5.docstatus !=2 and ifnull(t5.is_group,"No") = "No" and t6.name = "%s"))' % (based_on != 'Item Group' and item_group or '%(value)s', based_on != 'Item Group' and item_group or '%(value)s') + add_cond += ' AND t3.name = t2.item_code AND t3.item_group = t4.name and (t4.name = "%s" or t4.name IN (SELECT t5.name FROM `tabItem Group` t5,`tabItem Group` t6 WHERE t5.lft BETWEEN t6.lft and t6.rgt and t5.docstatus !=2 and t6.name = "%s"))' % (based_on != 'Item Group' and item_group or '%(value)s', based_on != 'Item Group' and item_group or '%(value)s') # Customer if customer or based_on == 'Customer':