From 00fc600e8ba27d6b26c2e689b23f00214a458420 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 22 Aug 2014 14:06:22 +0530 Subject: [PATCH] PP Tool: Raise material request based on projected qty in selected warehouse --- .../production_planning_tool/production_planning_tool.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 0d55f8bb5e..a15e3649a1 100644 --- a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py +++ b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py @@ -354,8 +354,8 @@ class ProductionPlanningTool(Document): def get_projected_qty(self): items = self.item_dict.keys() item_projected_qty = frappe.db.sql("""select item_code, sum(projected_qty) - from `tabBin` where item_code in (%s) group by item_code""" % - (", ".join(["%s"]*len(items)),), tuple(items)) + from `tabBin` where item_code in (%s) and warehouse=%s group by item_code""" % + (", ".join(["%s"]*len(items)), '%s'), tuple(items + [self.purchase_request_for_warehouse])) return dict(item_projected_qty)