From 4631abfb71846462a1d2af2a799e3be56f5fd6ab Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 31 May 2013 14:00:07 +0530 Subject: [PATCH] Update production_planning_tool.py --- .../production_planning_tool/production_planning_tool.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manufacturing/doctype/production_planning_tool/production_planning_tool.py b/manufacturing/doctype/production_planning_tool/production_planning_tool.py index 1686478f64..d4e41aca5f 100644 --- a/manufacturing/doctype/production_planning_tool/production_planning_tool.py +++ b/manufacturing/doctype/production_planning_tool/production_planning_tool.py @@ -317,9 +317,9 @@ class DocType: items_to_be_requested = webnotes._dict() for item in self.item_dict: - if flt(self.item_dict[item][0]) > item_projected_qty[item]: + if flt(self.item_dict[item][0]) > item_projected_qty.get(item, 0): # shortage - requested_qty = flt(self.item_dict[item][0]) - item_projected_qty[item] + requested_qty = flt(self.item_dict[item][0]) - item_projected_qty.get(item, 0) # comsider minimum order qty requested_qty = requested_qty > flt(self.item_dict[item][3]) and \ requested_qty or flt(self.item_dict[item][3]) @@ -379,4 +379,4 @@ class DocType: webnotes.msgprint("Following Material Request created successfully: \n%s" % "\n".join(pur_req)) else: - webnotes.msgprint("Nothing to request") \ No newline at end of file + webnotes.msgprint("Nothing to request")