feat: validate linked sales order on material request creation
This commit is contained in:
parent
8f7c7a6882
commit
86e650c1ed
@ -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):
|
||||
|
@ -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],
|
||||
}
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user