I am trying to execute the whitelist function: erpnext.manufacturing.doctype.work_order.work_order.make_work_order(bom_no, item, qty=0, project=None, variant_items=None)
from a custom server side script.
It is not working at all. Does not matter in what way I make the call, it just jams with TypeError: make_work_order() missing 2 required positional arguments: ‘bom_no’ and ‘item’
here is the code:
boms = frappe.get_list("BOM", filters=[["BOM Item","item_code","=",bom_item.item_code]], fields=["name", "item"], as_list = False)
if len(boms) == 1:
parent_bom = boms[0]
wo_name = frappe.call("erpnext.manufacturing.doctype.work_order.work_order.make_work_order", args = {
"bom_no" : parent_bom.name,
"item" : parent_bom.item,
"qty" : bom_item.qty
})
The values in parent_bom are filled out, and qty
has been checked and contains a value.
parent_bom = {'name': 'BOM-MAN-000', 'item': 'FISS-10'}, item.qty = 1