From d3db58d6b447670efa5af7a552899afed3806d11 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 11 Jan 2012 17:48:09 +0530 Subject: [PATCH] Pull only SO which has production/subcontracted item --- .../production_planning_tool/production_planning_tool.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/erpnext/production/doctype/production_planning_tool/production_planning_tool.py b/erpnext/production/doctype/production_planning_tool/production_planning_tool.py index 4ed37757dd..7f65021d53 100644 --- a/erpnext/production/doctype/production_planning_tool/production_planning_tool.py +++ b/erpnext/production/doctype/production_planning_tool/production_planning_tool.py @@ -59,10 +59,11 @@ class DocType: select distinct t1.name, t1.transaction_date, t1.customer, t1.grand_total from - `tabSales Order` t1, `tabDelivery Note Packing Detail` t2 + `tabSales Order` t1, `tabDelivery Note Packing Detail` t2, tabItem t3 where - t1.name = t2.parent and t2.parenttype = 'Sales Order' and t1.docstatus = 1 + t1.name = t2.parent and t2.parenttype = 'Sales Order' and t1.docstatus = 1 and t3.name = t2.item_code and ifnull(t1.per_delivered, 0) < 100 and t1.status != 'Stopped' and company = '%s' %s + and (ifnull(t3.is_pro_applicable, 'No') = 'Yes' or ifnull(t3.is_sub_contracted_item, 'No') = 'Yes') order by t1.name desc """% (self.doc.company, cond), as_dict = 1)