Let’s see, I have a custom Doctype that is a duplicate of the Production Order, but with some fields modified. When I select an Item or a quantity for manufacturing, the BOM that corresponds to the selected Item must be automatically assigned, but, instead, the following error occurs:
Traceback (most recent call last):
File "/home/frappe/frappe-bench/apps/frappe/frappe/app.py", line 62, in application
response = frappe.handler.handle ()
File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 22, in handle
data = execute_cmd (cmd)
File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 53, in execute_cmd
return frappe.call (method, ** frappe.form_dict)
File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 939, in call
return fn (* args, ** newargs)
File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 81, in runserverobj
frappe.desk.form.run_method.runserverobj (method, docs = docs, dt = dt, dn = dn, arg = arg, args = args)
File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/run_method.py", line 34, in runserverobj
fnargs, varargs, varkw, defaults = inspect.getargspec (getattr (doc, method))
AttributeError: 'Document' object has no attribute 'erpnext.manufacturing.doctype.ot_gran_formato.ot_gran_formato.get_items_and_operations_from_bom'
In fact, the appropriate BOM is assigned to the BOM field, but the error occurs and does not load the list of material required in the table for the Item to be manufactured.
The code in the JS file related to the BOM event is as follows:
bom_no: function (frm) {
return frm.call ({
method: "erpnext.manufacturing.doctype.ot_gran_formato.ot_gran_formato.get_items_and_operations_from_bom",
doc: cur_frm.doc,
freeze: true
});
}
How can I fix this? I’ve been stuck for a long time and I need this to work.
Thanks in advance!
PS: In PY file the function get_items_and_operations_from_bom is not whitelisted.