fix: check for both hold and closed status in po

This commit is contained in:
Mangesh-Khairnar 2019-03-12 13:39:01 +05:30
parent 4f74313baf
commit 873c579bb4
2 changed files with 3 additions and 3 deletions

View File

@ -232,7 +232,7 @@ class PurchaseOrder(BuyingController):
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')

View File

@ -13,7 +13,7 @@ from frappe.model.mapper import get_mapped_doc
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 @@ class MaterialRequest(BuyingController):
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):