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.
This commit is contained in:
Mihir Kandoi
2026-06-22 07:47:54 +05:30
parent c188ed59ec
commit 48d49cdcd2

View File

@@ -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),