diff --git a/erpnext/manufacturing/doctype/production_plan/production_plan.py b/erpnext/manufacturing/doctype/production_plan/production_plan.py index d689595bc1c..518e543e365 100644 --- a/erpnext/manufacturing/doctype/production_plan/production_plan.py +++ b/erpnext/manufacturing/doctype/production_plan/production_plan.py @@ -965,6 +965,7 @@ class ProductionPlan(Document): if material_request_type == "Material Transfer" else None, "qty": item.quantity - item.requested_qty, + "uom": item.uom, "schedule_date": schedule_date, "warehouse": item.warehouse, "sales_order": item.sales_order, @@ -1928,7 +1929,7 @@ def get_reserved_qty_for_production_plan(item_code, warehouse): frappe.qb.from_(table) .inner_join(child) .on(table.name == child.parent) - .select(Sum(child.required_bom_qty)) + .select(Sum(child.quantity * child.conversion_factor)) .where( (table.docstatus == 1) & (child.item_code == item_code) diff --git a/erpnext/manufacturing/doctype/production_plan/test_production_plan.py b/erpnext/manufacturing/doctype/production_plan/test_production_plan.py index 0a2bb424cae..7fd7127a01e 100644 --- a/erpnext/manufacturing/doctype/production_plan/test_production_plan.py +++ b/erpnext/manufacturing/doctype/production_plan/test_production_plan.py @@ -1256,7 +1256,6 @@ class TestProductionPlan(IntegrationTestCase): after_qty = flt(frappe.db.get_value("Bin", bin_name, "reserved_qty_for_production_plan")) self.assertEqual(after_qty, before_qty) - completed_plans = get_non_completed_production_plans() for plan in plans: self.assertFalse(plan in completed_plans)