Merge pull request #1853 from anandpdoshi/anand-wip
Material Request: fixed series issue in insert_purchase_request
diff --git a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py
index a59e0e9..e96dcbb 100644
--- a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py
+++ b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py
@@ -370,10 +370,8 @@
if items_to_be_requested:
for item in items_to_be_requested:
item_wrapper = frappe.get_doc("Item", item)
- pr_doc = frappe.get_doc({
- "doctype": "Material Request",
- "__islocal": 1,
- "naming_series": "IDT",
+ pr_doc = frappe.new_doc("Material Request")
+ pr_doc.update({
"transaction_date": nowdate(),
"status": "Draft",
"company": self.company,