mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-18 17:08:42 +00:00
refactor(subcontracting): fetch customer_warehouse only when needed
In `validate_manufacture`, `customer_warehouse` is read only inside the `skip_transfer` branch but was fetched unconditionally, wasting a lookup on the non-skip-transfer path. Move it inside the branch that uses it.
This commit is contained in:
@@ -247,10 +247,10 @@ class SubcontractingInwardController:
|
||||
and frappe.get_cached_value("Item", item.item_code, "is_customer_provided_item")
|
||||
]
|
||||
|
||||
customer_warehouse = frappe.get_cached_value(
|
||||
"Subcontracting Inward Order", self.subcontracting_inward_order, "customer_warehouse"
|
||||
)
|
||||
if frappe.get_cached_value("Work Order", self.work_order, "skip_transfer"):
|
||||
customer_warehouse = frappe.get_cached_value(
|
||||
"Subcontracting Inward Order", self.subcontracting_inward_order, "customer_warehouse"
|
||||
)
|
||||
table = frappe.qb.DocType("Subcontracting Inward Order Received Item")
|
||||
query = (
|
||||
frappe.qb.from_(table)
|
||||
|
||||
Reference in New Issue
Block a user