fix: check for both hold and closed status in po
diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.py b/erpnext/buying/doctype/purchase_order/purchase_order.py
index bbe8128..a63fe26 100644
--- a/erpnext/buying/doctype/purchase_order/purchase_order.py
+++ b/erpnext/buying/doctype/purchase_order/purchase_order.py
@@ -232,7 +232,7 @@
if self.is_subcontracted == "Yes":
self.update_reserved_qty_for_subcontract()
- self.check_for_closed_status()
+ self.check_on_hold_or_closed_status()
frappe.db.set(self,'status','Cancelled')
diff --git a/erpnext/stock/doctype/material_request/material_request.py b/erpnext/stock/doctype/material_request/material_request.py
index 7a199a4..fc01ec7 100644
--- a/erpnext/stock/doctype/material_request/material_request.py
+++ b/erpnext/stock/doctype/material_request/material_request.py
@@ -13,7 +13,7 @@
from erpnext.stock.stock_balance import update_bin_qty, get_indented_qty
from erpnext.controllers.buying_controller import BuyingController
from erpnext.manufacturing.doctype.work_order.work_order import get_item_details
-from erpnext.buying.utils import check_for_closed_status, validate_for_items
+from erpnext.buying.utils import check_on_hold_or_closed_status, validate_for_items
from erpnext.stock.doctype.item.item import get_item_defaults
from six import string_types
@@ -100,7 +100,7 @@
def before_cancel(self):
# if MRQ is already closed, no point saving the document
- check_for_closed_status(self.doctype, self.name)
+ check_on_hold_or_closed_status(self.doctype, self.name)
self.set_status(update=True, status='Cancelled')
def check_modified_date(self):