perf: avoid duplicate fetching of stock qty

This commit is contained in:
Ankush Menat
2025-06-04 16:57:36 +05:30
parent c06a361348
commit 4dc2969fa6

View File

@@ -21,7 +21,11 @@ class SellingController(StockController):
def onload(self):
super().onload()
if self.doctype in ("Sales Order", "Delivery Note", "Sales Invoice", "Quotation"):
if (
self.doctype in ("Sales Order", "Delivery Note", "Sales Invoice", "Quotation")
and self.docstatus.is_draft()
and not hasattr(self, "_action")
):
for item in self.get("items") + (self.get("packed_items") or []):
company = self.company