From a342db38dea370df9f23af1bf126b3030db12909 Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Mon, 22 Jun 2026 07:48:46 +0530 Subject: [PATCH] refactor(subcontracting): drop redundant scio_item_name check In `update_inward_order_item`, the walrus assignment `scio_item_name :=` is already part of the truthy `if` condition, so the nested `if scio_item_name:` is always true. Remove it and dedent the body. --- erpnext/controllers/subcontracting_inward_controller.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/erpnext/controllers/subcontracting_inward_controller.py b/erpnext/controllers/subcontracting_inward_controller.py index 92717975615..5c6ce75d8d3 100644 --- a/erpnext/controllers/subcontracting_inward_controller.py +++ b/erpnext/controllers/subcontracting_inward_controller.py @@ -645,10 +645,9 @@ class SubcontractingInwardController: "Work Order", self.work_order, "subcontracting_inward_order_item" ) ): - if scio_item_name: - frappe.get_doc( - "Subcontracting Inward Order Item", scio_item_name - ).update_manufacturing_qty_fields() + frappe.get_doc( + "Subcontracting Inward Order Item", scio_item_name + ).update_manufacturing_qty_fields() elif self.purpose in ["Subcontracting Delivery", "Subcontracting Return"]: fieldname = "delivered_qty" if self.purpose == "Subcontracting Delivery" else "returned_qty" qty_map = defaultdict(lambda: defaultdict(float))