diff --git a/erpnext/controllers/selling_controller.py b/erpnext/controllers/selling_controller.py index e2d7307f24..95578cb38d 100644 --- a/erpnext/controllers/selling_controller.py +++ b/erpnext/controllers/selling_controller.py @@ -257,11 +257,11 @@ class SellingController(StockController): so_warehouse = so_item and so_item[0]["warehouse"] or "" return so_qty, so_warehouse - def check_close_sales_order(self, ref_fieldname): + def check_sales_order_on_hold_or_close(self, ref_fieldname): for d in self.get("items"): if d.get(ref_fieldname): status = frappe.db.get_value("Sales Order", d.get(ref_fieldname), "status") - if status == "Closed": + if status == "Closed" or status == "On Hold": frappe.throw(_("Sales Order {0} is {1}").format(d.get(ref_fieldname), status)) def update_reserved_qty(self):