fix: job card error handling for operations field

This commit is contained in:
pateljannat 2020-11-24 15:37:30 +05:30
parent da878c43fc
commit b67ebc7636

View File

@ -353,7 +353,9 @@ def get_operation_details(work_order, operation):
@frappe.whitelist()
def get_operations(doctype, txt, searchfield, start, page_len, filters):
if filters.get("work_order"):
if not filters.get("work_order"):
frappe.msgprint(_("Please select a Work Order first."))
return []
args = {"parent": filters.get("work_order")}
if txt:
args["operation"] = ("like", "%{0}%".format(txt))