Hello,
I am getting the following error when I try to create and save a Production Plan.
Installed Apps
ERPNext: v14.35.0 (version-14)
Frappe Framework: v14.45.0 (version-14)
Frappe HR: v14.10.1 (version-14)
India Compliance: v14.15.1 (version-14)
Payments: v0.0.1 (develop)
Error is:
App Versions
{
"erpnext": "14.35.0",
"frappe": "14.45.0",
"hrms": "14.10.1",
"india_compliance": "14.15.1",
"payments": "0.0.1"
}
Route
Form/Production Plan/new-production-plan-1
Traceback
Traceback (most recent call last):
File "apps/frappe/frappe/app.py", line 94, in application
response = frappe.api.handle()
File "apps/frappe/frappe/api.py", line 54, in handle
return frappe.handler.handle()
File "apps/frappe/frappe/handler.py", line 47, in handle
data = execute_cmd(cmd)
File "apps/frappe/frappe/handler.py", line 85, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File "apps/frappe/frappe/__init__.py", line 1620, in call
return fn(*args, **newargs)
File "apps/frappe/frappe/desk/form/save.py", line 28, in savedocs
doc.save()
File "apps/frappe/frappe/model/document.py", line 305, in save
return self._save(*args, **kwargs)
File "apps/frappe/frappe/model/document.py", line 327, in _save
return self.insert()
File "apps/frappe/frappe/model/document.py", line 259, in insert
self.run_before_save_methods()
File "apps/frappe/frappe/model/document.py", line 1051, in run_before_save_methods
self.run_method("validate")
File "apps/frappe/frappe/model/document.py", line 915, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File "apps/frappe/frappe/model/document.py", line 1277, in composer
return composed(self, method, *args, **kwargs)
File "apps/frappe/frappe/model/document.py", line 1259, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File "apps/frappe/frappe/model/document.py", line 912, in fn
return method_object(*args, **kwargs)
File "apps/erpnext/erpnext/manufacturing/doctype/production_plan/production_plan.py", line 42, in validate
self.validate_sales_orders()
File "apps/erpnext/erpnext/manufacturing/doctype/production_plan/production_plan.py", line 57, in validate_sales_orders
msg = _("No items are available in the sales order {0} for production").format(sales_orders[0])
IndexError: list index out of range
Request Data
{
"type": "POST",
"args": {
"doc": "{\"docstatus\":0,\"doctype\":\"Production Plan\",\"name\":\"new-production-plan-1\",\"__islocal\":1,\"__unsaved\":1,\"owner\":\"Administrator\",\"naming_series\":\"MFG-PP-.YYYY.-\",\"company\":\"Tritech Disconnectors (India) Private Limited\",\"get_items_from\":\"\",\"posting_date\":\"2023-08-16\",\"sales_order_status\":\"\",\"combine_items\":0,\"combine_sub_items\":0,\"skip_available_sub_assembly_item\":0,\"include_non_stock_items\":1,\"include_subcontracted_items\":1,\"include_safety_stock\":0,\"ignore_existing_ordered_qty\":0,\"total_planned_qty\":0,\"total_produced_qty\":0,\"status\":\"Draft\",\"po_items\":[{\"docstatus\":0,\"doctype\":\"Production Plan Item\",\"name\":\"new-production-plan-item-1\",\"__islocal\":1,\"__unsaved\":1,\"owner\":\"Administrator\",\"include_exploded_items\":1,\"planned_start_date\":\"2023-08-16\",\"pending_qty\":0,\"ordered_qty\":0,\"stock_uom\":\"Nos\",\"produced_qty\":0,\"parent\":\"new-production-plan-1\",\"parentfield\":\"po_items\",\"parenttype\":\"Production Plan\",\"idx\":1,\"item_code\":\"I33FX00\",\"bom_no\":\"BOM-I33FX00-004\",\"planned_qty\":100,\"temporary_name\":\"new-production-plan-item-1\"}]}",
"action": "Save"
},
"btn": {
"jQuery360099135546616313671": {
"events": {
"click": [
{
"type": "click",
"origType": "click",
"guid": 626,
"namespace": ""
}
]
}
}
},
"freeze": true,
"headers": {},
"error_handlers": {},
"url": "/api/method/frappe.desk.form.save.savedocs"
}
Response Data
{
"exception": "IndexError: list index out of range"
}
Request you to guide me in resolving the error.