From d9479ef5f2103caeb102dea756e5fb655882c30d Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 24 Oct 2024 22:10:43 +0530 Subject: [PATCH] fix: map item_ID instead of item_code while creating subcontracting order from PO (#43822) --- .../doctype/subcontracting_order/subcontracting_order.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/erpnext/subcontracting/doctype/subcontracting_order/subcontracting_order.py b/erpnext/subcontracting/doctype/subcontracting_order/subcontracting_order.py index baac48b695..055644bfaf 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, -- GitLab