perf: avoid duplicate fetching of stock qty
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user