From 1a3c27bbeae137d616c1641d3bd82cf744dbe25a Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 12 Feb 2019 17:38:37 +0530 Subject: [PATCH] fix: Make work order from production plan considering already ordered qty --- .../manufacturing/doctype/production_plan/production_plan.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/manufacturing/doctype/production_plan/production_plan.py b/erpnext/manufacturing/doctype/production_plan/production_plan.py index d17adf6369..97a8ea7e3c 100644 --- a/erpnext/manufacturing/doctype/production_plan/production_plan.py +++ b/erpnext/manufacturing/doctype/production_plan/production_plan.py @@ -276,8 +276,8 @@ class ProductionPlan(Document): item_dict[(d.item_code, d.material_request_item, d.warehouse)] = item_details else: item_details.update({ - "qty":flt(item_dict.get((d.item_code, d.sales_order, d.warehouse),{}) - .get("qty")) + flt(d.planned_qty) + "qty": flt(item_dict.get((d.item_code, d.sales_order, d.warehouse),{}) + .get("qty")) + (flt(d.planned_qty) - flt(d.ordered_qty)) }) item_dict[(d.item_code, d.sales_order, d.warehouse)] = item_details