Hello!
I have fields for Production Order and BOM. What I want to do is fill in the BOM linked field with the PRO linked BOM and its multilevel BOM’s. Eg. If PRO 1 is created from Bom1
and Bom1
is made up of Bom2
and Bom3
, the BOM field should show bom1
,bom2
, and bom3
. If bom2
and bom3
are also multilevel boms, then those boms under bom2
and bom3
should also be in the linked field.
I made a recursive python function to return an array of the boms to be included as options. The problem is, I have no idea on how to set this as the BOM field options.
I already tried :
frappe.meta.get_docfield(frm.doctype, "bom", frm.docname).options=options.join("\n")
and it returns an error saying “Doctype all-the-array-entries not found”, “resource does not exist”.
Any ideas on how to make this work?
Thanks!