AttributeError: 'ProductionOrder' object has no attribute 'erpnext.manufacturing.doctype.production_planning_tool.production_planning_tool.raise_material_requests'

frappe.ui.form.on(“Production Order”, “plan_or_revise”, function(frm) {
frappe.call({
// doc: frm.doc,
method: “erpnext.manufacturing.doctype.production_planning_tool.production_planning_tool.raise_material_requests”,
doc: frm.doc,
});
});

When we call above ajax the we get this error:

Traceback (most recent call last):
File “/windows/sapconproject/frappe-bench/apps/frappe/frappe/app.py”, line 55, in application
response = frappe.handler.handle()
File “/windows/sapconproject/frappe-bench/apps/frappe/frappe/handler.py”, line 21, in handle
data = execute_cmd(cmd)
File “/windows/sapconproject/frappe-bench/apps/frappe/frappe/handler.py”, line 52, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/windows/sapconproject/frappe-bench/apps/frappe/frappe/init.py”, line 907, in call
return fn(*args, **newargs)
File “/windows/sapconproject/frappe-bench/apps/frappe/frappe/handler.py”, line 80, in runserverobj
frappe.desk.form.run_method.runserverobj(method, docs=docs, dt=dt, dn=dn, arg=arg, args=args)
File “/windows/sapconproject/frappe-bench/apps/frappe/frappe/desk/form/run_method.py”, line 33, in runserverobj
fnargs, varargs, varkw, defaults = inspect.getargspec(getattr(doc, method))
AttributeError: ‘ProductionOrder’ object has no attribute ‘erpnext.manufacturing.doctype.production_planning_tool.production_planning_tool.raise_material_requests’

Calling a function which is defined inside a Class of another doctype is not possible via frappe.call. You can only call whitelisted functions (and outside Class) of other doctypes.

Thanks for response

Call method in class via JS: