From 63c5dccb4bfb906945c1354c4cf30b15165d00a2 Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Mon, 22 Jun 2026 07:50:20 +0530 Subject: [PATCH] fix(subcontracting): guard empty raw-material list before strict zip `update_inward_order_received_items_for_manufacture` unpacks `zip(*item_code_wh.keys(), strict=True)`. When the manufacture entry has no raw-material rows (all rows are finished/secondary/scrap), `item_code_wh` is empty and the unpack raises `ValueError: not enough values to unpack`. Return early when there are no such rows, mirroring the `if secondary_items:` guard already present in `update_inward_order_secondary_items`. --- erpnext/controllers/subcontracting_inward_controller.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/erpnext/controllers/subcontracting_inward_controller.py b/erpnext/controllers/subcontracting_inward_controller.py index 622a9d26eee..3c2dcf8f4e0 100644 --- a/erpnext/controllers/subcontracting_inward_controller.py +++ b/erpnext/controllers/subcontracting_inward_controller.py @@ -793,6 +793,9 @@ class SubcontractingInwardController: for item in self.items if not item.is_finished_item and not item.secondary_item_type and not item.is_legacy_scrap_item ] + if not items: + return + item_code_wh = frappe._dict( { (