feat: validate linked sales order on material request creation

This commit is contained in:
Mangesh-Khairnar 2019-03-02 20:30:21 +05:30
parent 8f7c7a6882
commit 86e650c1ed
2 changed files with 2 additions and 2 deletions

View File

@ -261,7 +261,7 @@ class SellingController(StockController):
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" or status == "On Hold":
if status in ("Closed", "On Hold"):
frappe.throw(_("Sales Order {0} is {1}").format(d.get(ref_fieldname), status))
def update_reserved_qty(self):

View File

@ -128,7 +128,7 @@ frappe.ui.form.on('Material Request', {
},
get_query_filters: {
docstatus: 1,
status: ["!=", "Closed"],
status: ["not in", ["Closed", "On Hold"]],
per_delivered: ["<", 99.99],
}
});