Create Manufacture MRs for BOM Items

Corrects an issue where items with BOMs have Purchase material request submitted instead of Manufacture material requests.
This commit is contained in:
bcornwellmott 2016-06-15 11:16:12 -07:00 committed by GitHub
parent 2cb7a9f235
commit c0a3311836

View File

@ -449,9 +449,12 @@ class ProductionPlanningTool(Document):
"transaction_date": nowdate(),
"status": "Draft",
"company": self.company,
"requested_by": frappe.session.user,
"material_request_type": "Purchase"
"requested_by": frappe.session.user
})
if item_wrapper.default_bom:
material_request.update({"material_request_type": "Manufacture"})
else:
material_request.update({"material_request_type": "Purchase"})
for sales_order, requested_qty in items_to_be_requested[item].items():
material_request.append("items", {
"doctype": "Material Request Item",