Production Plan fix

This commit is contained in:
Zlash65 2018-09-27 18:49:52 +05:30
parent c24d2fdf6c
commit 143d4da901

View File

@ -14,15 +14,17 @@ def work():
from erpnext.projects.doctype.timesheet.timesheet import OverlapError
ppt = frappe.get_doc("Production Planning Tool", "Production Planning Tool")
ppt = frappe.new_doc("Production Plan")
ppt.company = erpnext.get_default_company()
ppt.use_multi_level_bom = 1
# ppt.use_multi_level_bom = 1 #refactored
ppt.get_items_from = "Sales Order"
ppt.purchase_request_for_warehouse = "Stores - WPL"
# ppt.purchase_request_for_warehouse = "Stores - WPL" # refactored
ppt.run_method("get_open_sales_orders")
ppt.run_method("get_items")
ppt.run_method("raise_work_orders")
ppt.run_method("raise_material_requests")
ppt.save()
ppt.submit()
ppt.run_method("raise_work_orders")
frappe.db.commit()
# submit work orders