From fee003a82dd2b0ee8c8a15e76e8e8f86e49492ae Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Tue, 11 Aug 2026 14:08:20 +0530 Subject: [PATCH] fix: preserve original operation idx in manually created Job Cards The Create Job Card dialog on Work Order lists only pending operations, so the row idx sent to make_job_card is the dialog's position, not the Work Order Operation idx. create_job_card stamped that dialog idx into operation_row_id, and get_required_items then matched raw materials of whichever operation held that idx originally. Resolve idx server-side from the Work Order Operation row that get_operation_details already looks up by name. Fixes https://github.com/frappe/erpnext/issues/57985 --- erpnext/manufacturing/doctype/work_order/work_order.py | 1 + 1 file changed, 1 insertion(+) diff --git a/erpnext/manufacturing/doctype/work_order/work_order.py b/erpnext/manufacturing/doctype/work_order/work_order.py index bb3d256ffee..2af7497564b 100644 --- a/erpnext/manufacturing/doctype/work_order/work_order.py +++ b/erpnext/manufacturing/doctype/work_order/work_order.py @@ -2825,6 +2825,7 @@ def get_operation_details(name, work_order, parent_bom): for row in work_order.operations: if row.name == name: return { + "idx": row.idx, "workstation": row.workstation, "workstation_type": row.workstation_type, "source_warehouse": row.source_warehouse,