I encountered an error while implementing conditions in the workflow for the below code.
Anyone please help me resolve this issue?
getbom = frappe.get_doc(“BOM”, doc.get(‘bom_no’))
bom_item_codes = [item.item_code for item in getbom.get(‘items’)]
workorder_item_codes = [item.item_code for item in doc.get(‘required_items’)]
all(item_code in bom_item_codes for item_code in workorder_item_codes)
There is no indentation error, but the get_doc function is not being allowed. Can you suggest code to cross-check the items in the work order with BOM items?
getbom = frappe.get_doc(“BOM”, doc.get(‘bom_no’))
bom_item_codes = [item.item_code for item in getbom.get(‘items’)]
workorder_item_codes = [item.item_code for item in doc.get(‘required_items’)]
all(item_code in bom_item_codes for item_code in workorder_item_codes)