mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-27 17:04:47 +00:00
perf: avoid duplicate fetching of stock qty
This commit is contained in:
@@ -21,7 +21,11 @@ class SellingController(StockController):
|
|||||||
|
|
||||||
def onload(self):
|
def onload(self):
|
||||||
super().onload()
|
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 []):
|
for item in self.get("items") + (self.get("packed_items") or []):
|
||||||
company = self.company
|
company = self.company
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user