diff --git a/erpnext/stock/doctype/material_request/material_request.py b/erpnext/stock/doctype/material_request/material_request.py index 06df636cd7..4fb5f5d639 100644 --- a/erpnext/stock/doctype/material_request/material_request.py +++ b/erpnext/stock/doctype/material_request/material_request.py @@ -372,6 +372,7 @@ def raise_production_orders(material_request): mr= frappe.get_doc("Material Request", material_request) errors =[] production_orders = [] + default_wip_warehouse = frappe.db.get_single_value("Manufacturing Settings", "default_wip_warehouse") for d in mr.items: if (d.qty - d.ordered_qty) >0: if frappe.db.get_value("BOM", {"item": d.item_code, "is_default": 1}): @@ -379,6 +380,7 @@ def raise_production_orders(material_request): prod_order.production_item = d.item_code prod_order.qty = d.qty - d.ordered_qty prod_order.fg_warehouse = d.warehouse + prod_order.wip_warehouse = default_wip_warehouse prod_order.description = d.description prod_order.stock_uom = d.uom prod_order.expected_delivery_date = d.schedule_date