Merge pull request #51019 from mihir-kandoi/gh50781

This commit is contained in:
Mihir Kandoi
2025-12-11 10:23:28 +05:30
committed by GitHub

View File

@@ -845,7 +845,10 @@ def raise_work_orders(material_request, company):
for d in mr.items:
if (d.stock_qty - d.ordered_qty) > 0:
if frappe.db.exists("BOM", {"item": d.item_code, "is_default": 1}):
if frappe.db.exists("BOM", {"item": d.item_code, "is_default": 1, "is_active": 1}) or (
(variant_of := frappe.get_value("Item", d.item_code, "variant_of"))
and frappe.db.exists("BOM", {"item": variant_of, "is_default": 1, "is_active": 1})
):
wo_order = frappe.new_doc("Work Order")
wo_order.update(
{