From 1c276e98283d212aeeddfc498d5a7e9d3e2bb127 Mon Sep 17 00:00:00 2001 From: Mangesh-Khairnar Date: Fri, 1 Mar 2019 16:37:49 +0530 Subject: [PATCH] feat: validate on hold sales order --- erpnext/stock/doctype/delivery_note/delivery_note.js | 2 +- erpnext/stock/doctype/delivery_note/delivery_note.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.js b/erpnext/stock/doctype/delivery_note/delivery_note.js index 4d719b287a..0ac53c5cf0 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.js +++ b/erpnext/stock/doctype/delivery_note/delivery_note.js @@ -140,7 +140,7 @@ erpnext.stock.DeliveryNoteController = erpnext.selling.SellingController.extend( }, get_query_filters: { docstatus: 1, - status: ["!=", "Closed"], + status: ["not in", ["Closed", "On Hold"]], per_delivered: ["<", 99.99], company: me.frm.doc.company, project: me.frm.doc.project || undefined, diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.py b/erpnext/stock/doctype/delivery_note/delivery_note.py index 869b614f7f..b39abdbeb3 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.py +++ b/erpnext/stock/doctype/delivery_note/delivery_note.py @@ -103,7 +103,7 @@ class DeliveryNote(SellingController): self.set_status() self.so_required() self.validate_proj_cust() - self.check_close_sales_order("against_sales_order") + self.check_sales_order_on_hold_or_close("against_sales_order") self.validate_for_items() self.validate_warehouse() self.validate_uom_is_integer("stock_uom", "stock_qty") @@ -223,7 +223,7 @@ class DeliveryNote(SellingController): self.make_gl_entries() def on_cancel(self): - self.check_close_sales_order("against_sales_order") + self.check_sales_order_on_hold_or_close("against_sales_order") self.check_next_docstatus() self.update_prevdoc_status()