From 3d1f01ffc1aaa26cddfc5ad805178e744c9fe24c Mon Sep 17 00:00:00 2001 From: Javier Wong Date: Tue, 16 Feb 2016 11:02:32 +0800 Subject: [PATCH] Fixed Get Open Sales Orders with Item Filter Previously Get Open Sales Orders with Item Filter does not filter properly and instead returns Sales Orders with all Items. --- .../production_planning_tool/production_planning_tool.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py index c907339766..46396ba103 100644 --- a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py +++ b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py @@ -61,7 +61,7 @@ class ProductionPlanningTool(Document): and so.company = %(company)s and so_item.qty > so_item.delivered_qty {0} and (exists (select name from `tabItem` item where item.name=so_item.item_code - and (item.is_pro_applicable = 1 or item.is_sub_contracted_item = 1 {1})) + and ((item.is_pro_applicable = 1 or item.is_sub_contracted_item = 1) {1})) or exists (select name from `tabPacked Item` pi where pi.parent = so.name and pi.parent_item = so_item.item_code and exists (select name from `tabItem` item where item.name=pi.item_code