From 48d49cdcd2ebe780d12269f0152c624316dea49a Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Mon, 22 Jun 2026 07:47:54 +0530 Subject: [PATCH] fix(subcontracting): fix format placeholders in FG warehouse validation message `validate_manufacture` builds its "Target Warehouse for Finished Good must be same as Finished Good Warehouse ..." message with placeholders `{1}` and `{2}`, but only passes two positional args (indices 0 and 1). `str.format` raises `IndexError: Replacement index 2 out of range` instead of rendering the message, so a user who sets the wrong FG target warehouse gets an opaque traceback rather than the intended validation error. Renumber the placeholders to `{0}` and `{1}` to match the args. --- erpnext/controllers/subcontracting_inward_controller.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/controllers/subcontracting_inward_controller.py b/erpnext/controllers/subcontracting_inward_controller.py index 4907f2d8484..5bdca5528e8 100644 --- a/erpnext/controllers/subcontracting_inward_controller.py +++ b/erpnext/controllers/subcontracting_inward_controller.py @@ -230,7 +230,7 @@ class SubcontractingInwardController: ): frappe.throw( _( - "Target Warehouse for Finished Good must be same as Finished Good Warehouse {1} in Work Order {2} linked to the Subcontracting Inward Order." + "Target Warehouse for Finished Good must be same as Finished Good Warehouse {0} in Work Order {1} linked to the Subcontracting Inward Order." ).format( get_link_to_form("Warehouse", fg_warehouse), get_link_to_form("Work Order", self.work_order),