Set WIP warehouse in Pro Order based on Manufacturing Settings. Fixed #6636

This commit is contained in:
Nabin Hait 2016-11-21 18:09:55 +05:30
parent 8d161ef2e1
commit 075e33245e

View File

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