diff --git a/erpnext/controllers/selling_controller.py b/erpnext/controllers/selling_controller.py index dff14d91daa..9a70f6c3636 100644 --- a/erpnext/controllers/selling_controller.py +++ b/erpnext/controllers/selling_controller.py @@ -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