Merge pull request #49960 from aerele/support-50220

Fix/Support 50220
This commit is contained in:
Mihir Kandoi
2025-10-14 14:18:36 +05:30
committed by GitHub
2 changed files with 2 additions and 2 deletions

View File

@@ -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)

View File

@@ -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)