diff --git a/erpnext/subcontracting/doctype/subcontracting_order/subcontracting_order.py b/erpnext/subcontracting/doctype/subcontracting_order/subcontracting_order.py index baac48b695f2ce5f2ed6737f37e9347f82db0fb5..055644bfafff25e576e54d84a48599aa80e50e38 100644 --- a/erpnext/subcontracting/doctype/subcontracting_order/subcontracting_order.py +++ b/erpnext/subcontracting/doctype/subcontracting_order/subcontracting_order.py @@ -245,14 +245,16 @@ class SubcontractingOrder(SubcontractingController): item = frappe.get_doc("Item", si.fg_item) bom = ( frappe.db.get_value( - "Subcontracting BOM", {"finished_good": item.item_code, "is_active": 1}, "finished_good_bom" + "Subcontracting BOM", + {"finished_good": item.name, "is_active": 1}, + "finished_good_bom", ) or item.default_bom ) items.append( { - "item_code": item.item_code, + "item_code": item.name, "item_name": item.item_name, "schedule_date": self.schedule_date, "description": item.description,