From b752acf8034540ffe316fede77288ddbde99d1fa Mon Sep 17 00:00:00 2001 From: Salmanmulani <42264299+Salmanmulani@users.noreply.github.com> Date: Fri, 19 Jul 2019 11:44:49 +0530 Subject: [PATCH] fix: added default value for projected_qty in bin_dict `projected_qty` if not in `bin_dict` would return None. And when compared to an integer would result in a TypeError. This PR fixes this Co-authored-by: Shivam Mishra --- .../manufacturing/doctype/production_plan/production_plan.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/manufacturing/doctype/production_plan/production_plan.py b/erpnext/manufacturing/doctype/production_plan/production_plan.py index 06f238aa5c..3a77e2f209 100644 --- a/erpnext/manufacturing/doctype/production_plan/production_plan.py +++ b/erpnext/manufacturing/doctype/production_plan/production_plan.py @@ -505,7 +505,7 @@ def get_material_request_items(row, sales_order, total_qty = row['qty'] required_qty = 0 - if ignore_existing_ordered_qty or bin_dict.get("projected_qty") < 0: + if ignore_existing_ordered_qty or bin_dict.get("projected_qty", 0) < 0: required_qty = total_qty elif total_qty > bin_dict.get("projected_qty"): required_qty = total_qty - bin_dict.get("projected_qty")